1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-28 01:06:17 +00:00

The samba rc.d script uses some clever tricks to start (up to) 3 different

services using the same script. As a result it resets rcvar several times
in order to process the options for each service.

The changes I made on 2012/01/14 to facilitate the removal of set_rc_var()
from HEAD were effective in the case where the WINBIND option was off (the
case that I tested) because that causes the related portions of the rc.d
script to be removed completely on install. However, if installed from a
package, or installed using the the default OPTIONS, WINBIND is on, which
caused the last known rcvar to be winbind_enable.

Since the common case seems to be for users to use samba_enable (which
only enables smb_and nmb_ by default) the fact that rcvar=winbind_enable,
but that knob is off, caused the startup script to trip on a totally
unrelated portion of rc.subr.

So the fix is to move processing of the winbind_ stuff first, which leaves
the last known rcvar as smb_enable. Since running nmb without smb is a
very unlikely scenario, this should be safe for the common case, as well
as safe if the user enables winbind_.

Apologies all around for not catching this sooner, and thanks to the users
who reported the problem and stuck with me while I debugged it.

Bump PORTREVISION since this fix is needed for the common case, as
configured for the package.
This commit is contained in:
Doug Barton 2012-04-13 09:16:00 +00:00
parent 7984dbe606
commit b3ab9ed23a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=294765
6 changed files with 15 additions and 15 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= samba34
PORTVERSION= 3.4.16
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES?= net
MASTER_SITES= ${MASTER_SITE_SAMBA}
MASTER_SITE_SUBDIR= . old-versions rc pre

View File

@ -53,6 +53,10 @@ if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
fi
# XXX: Hack to enable check of the dependent variables
eval real_${rcvar}="\${${rcvar}:=NO}" ${rcvar}=YES
%%WINBIND%%# winbindd
%%WINBIND%%rcvar=winbindd_enable
%%WINBIND%%winbindd_enable=${winbindd_enable:=NO}
%%WINBIND%%winbindd_flags=${winbindd_flags=''}
# nmbd
rcvar=nmbd_enable
nmbd_enable=${nmbd_enable:=NO}
@ -61,10 +65,6 @@ nmbd_flags=${nmbd_flags="-D"}
rcvar=smbd_enable
smbd_enable=${smbd_enable:=NO}
smbd_flags=${smbd_flags="-D"}
%%WINBIND%%# winbindd
%%WINBIND%%rcvar=winbindd_enable
%%WINBIND%%winbindd_enable=${winbindd_enable:=NO}
%%WINBIND%%winbindd_flags=${winbindd_flags=''}
# Custom commands
extra_commands="reload status"
start_precmd="samba_start_precmd"

View File

@ -7,7 +7,7 @@
PORTNAME= ${SAMBA_BASENAME}35
PORTVERSION= 3.5.14
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES?= net
MASTER_SITES= ${MASTER_SITE_SAMBA}
MASTER_SITE_SUBDIR= . old-versions rc pre

View File

@ -53,6 +53,10 @@ if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
fi
# XXX: Hack to enable check of the dependent variables
eval real_${rcvar}="\${${rcvar}:=NO}" ${rcvar}=YES
%%WINBIND%%# winbindd
%%WINBIND%%rcvar=winbindd_enable
%%WINBIND%%winbindd_enable=${winbindd_enable:=NO}
%%WINBIND%%winbindd_flags=${winbindd_flags=''}
# nmbd
rcvar=nmbd_enable
nmbd_enable=${nmbd_enable:=NO}
@ -61,10 +65,6 @@ nmbd_flags=${nmbd_flags="-D"}
rcvar=smbd_enable
smbd_enable=${smbd_enable:=NO}
smbd_flags=${smbd_flags="-D"}
%%WINBIND%%# winbindd
%%WINBIND%%rcvar=winbindd_enable
%%WINBIND%%winbindd_enable=${winbindd_enable:=NO}
%%WINBIND%%winbindd_flags=${winbindd_flags=''}
# Custom commands
extra_commands="reload status"
start_precmd="samba_start_precmd"

View File

@ -7,7 +7,7 @@
PORTNAME= ${SAMBA_BASENAME}36
PORTVERSION= 3.6.4
PORTREVISION?= 0
PORTREVISION?= 1
CATEGORIES?= net
MASTER_SITES= ${MASTER_SITE_SAMBA}
MASTER_SITE_SUBDIR= . old-versions rc pre

View File

@ -53,6 +53,10 @@ if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
fi
# XXX: Hack to enable check of the dependent variables
eval real_${rcvar}="\${${rcvar}:=NO}" ${rcvar}=YES
%%WINBIND%%# winbindd
%%WINBIND%%rcvar=winbindd_enable
%%WINBIND%%winbindd_enable=${winbindd_enable:=NO}
%%WINBIND%%winbindd_flags=${winbindd_flags=''}
# nmbd
rcvar=nmbd_enable
nmbd_enable=${nmbd_enable:=NO}
@ -61,10 +65,6 @@ nmbd_flags=${nmbd_flags="-D"}
rcvar=smbd_enable
smbd_enable=${smbd_enable:=NO}
smbd_flags=${smbd_flags="-D"}
%%WINBIND%%# winbindd
%%WINBIND%%rcvar=winbindd_enable
%%WINBIND%%winbindd_enable=${winbindd_enable:=NO}
%%WINBIND%%winbindd_flags=${winbindd_flags=''}
# Custom commands
extra_commands="reload status"
start_precmd="samba_start_precmd"