[Samba] Upgrading samba from jessie (4.2) to stretch (4.5) in AD mode...

Rowland Penny rpenny at samba.org
Fri Jun 23 12:55:35 UTC 2017


On Fri, 23 Jun 2017 14:15:28 +0200
"L.P.H. van Belle via samba" <samba at lists.samba.org> wrote:

> Hai, 
> 
> The "scripts" are not the problem, i'll explain more. 
> 

I cannot really comment on the systemd settings because I do not use
it, but I can comment on this:

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/winbind" ]; then
		update-rc.d winbind defaults >/dev/null
		invoke-rc.d winbind start || exit $?
	fi
fi

Saying that is all down to a badly configured smb.conf is missing the point.
It would seem that debian is treating an upgrade of winbind as a new
install, so the code fragment above gets run and it makes the 'winbind'
init script run at boot and then tries to start winbind. Surely it
should be something like this:


if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
    SERVER_ROLE=$(samba-tool testparm --parameter-name="server role"  2>/dev/null | tail -1 || true)
    if [ "$SERVER_ROLE" != "active directory domain controller" ]; then
	    if [ -x "/etc/init.d/winbind" ]; then
		    update-rc.d winbind defaults >/dev/null
		    invoke-rc.d winbind start || exit $?
	    fi
    fi
fi

This way, winbind will only get enabled and started if smb.conf isn't
already set up as a DC, which it wont be, if it is a new install or if
smb.conf is set up as something else and Samba is being upgraded.

Rowland




More information about the samba mailing list