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

L.P.H. van Belle belle at bazuin.nl
Fri Jun 23 12:30:40 UTC 2017


Now, looking at this, we can make a bug report at debian. 

 # Automatically added by dh_installinit  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 


The problem Marco had, can be resolve like this.  
 # Automatically added by dh_installinit  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
		     sleep 0.5
		     WINBIND_START_PID="$(ps fax| grep winbindd |grep -v grep | awk {'print $1'} | head -n1)"
	           if [ ! -f /var/run/samba/winbindd.pid ];
			  echo "error, /var/run/samba/winbindd.pid does not exist, winbind is not starting, check your smb.conf"
		        exit 1
		     else 
			  WINBIND_START_PID_STARTED="$(cat /var/run/winbindd/pid)"
		        if [ "$WINBIND_START_PID" -eq "$WINBIND_START_PID_STARTED" ]; then 
				echo "winbind started successfully"
				exit 0
			  else
				echo "winbind fail to start or pid mismatch, check your smb.conf."
				exit 1
			  fi
		     fi
         fi
 fi 

And the part "exit 1", can be replace by, call a test-script that checks smb.conf for old settings. 

But then in nice code..  ;-) 
This way is more clear why winbind does not start. 
And same for smbd nmbd. 


Greetz, 

Louis

> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-bounces at lists.samba.org] Namens 
> L.P.H. van Belle via samba
> Verzonden: vrijdag 23 juni 2017 14:15
> Aan: samba at lists.samba.org
> Onderwerp: Re: [Samba] Upgrading samba from jessie (4.2) to 
> stretch (4.5) in AD mode...
> 
> Hai, 
> 
> The "scripts" are not the problem, i'll explain more. 
> 
> A failty configured smb.conf is the problem, or a smb.conf 
> which contained "removed" settings. 
> Which exist in a lots of setups. 
> You need to setup you smb.conf to match 4.5.x settings 
> "before" you upgrade, then you dont have any problems upgradeing. 
> 
> If we can think of a way to this before the upgrade starts.. 
> 
> - match settings for a new samba version 4.5.x
> - check agains smb.conf
> - correct these settings
> - and start upgrading. 
> For example, just before package install, call a 
> "test-smb.conf" script and run test.
> If it fails, skip the packages and point out what is the problem. 
> 
> But i dont see a way to do that, because, imo, its hard to 
> "correct" settings, based on what the installer, does not know. 
> And that is the way the user did setup, for some reason. 
> 
> Now samba 4.6 has samba-tool testparm that check failty idmappings. 
> But in Marco's case he would have had the same problem when 
> upgrading due to the change in security settings. 
> 
> Maybe, but this is more a question for developers.
> Make samba test agains current and new settings and before 
> upgrading a packages, is should have pointed out what is changed. 
> Like what a user "should" do before he upgrade to any new 
> version ( 4.2.x to 4.3. to 4.4.x etc ) And in this case of 
> "Debian" packages. 
> 
> Any version upgrade from wheezy ( 3.6.x or 4.1.17), Jessie 
> 4.2.x , stretch 4.5.x can be effected by this. 
> It's all about the smb.conf settings. 
> This is why i have : 
> http://downloads.van-belle.nl/samba4/Upgrade-info.txt
> But i'm missing the security = setting ( probely because it's 
> removed as of 4.0 ) I started with 4.1 in the Upgrade-info.txt 
> 
> 
> Greetz, 
> 
> Louis
> 
> 
> 
> 
>  
> 
> > -----Oorspronkelijk bericht-----
> > Van: samba [mailto:samba-bounces at lists.samba.org] Namens 
> Rowland Penny 
> > via samba
> > Verzonden: vrijdag 23 juni 2017 13:23
> > Aan: samba at lists.samba.org
> > Onderwerp: Re: [Samba] Upgrading samba from jessie (4.2) to stretch 
> > (4.5) in AD mode...
> > 
> > On Fri, 23 Jun 2017 12:40:35 +0200
> > Marco Gaiarin via samba <samba at lists.samba.org> wrote:
> > 
> > > Mandi! Rowland Penny via samba
> > >   In chel di` si favelave...
> > > 
> > > > > Better to fire up a bug in debian BTS?
> > > 
> > > > Which version of samba did you upgrade to ?
> > > > Where did it come from, a Debian repo or Louis's ?
> > > 
> > > Louis's repo. 2:4.5.8+dfsg-2~bpo8+1 .
> > > 
> > > 
> > > > Which package is the postinst script in ?
> > > 
> > > 'winbind'.
> > > 
> > > > If I can get this info, I will check just what the script
> > is trying
> > > > to do.
> > > 
> > 
> > OK, winbind used to be installed automatically, but you must now 
> > install it manually, so does this mean that winbind will be 
> treated as 
> > a new installation by Debian ?
> > 
> > If so, it appears that this is run:
> > 
> > if deb-systemd-helper --quiet was-enabled winbind.service; then
> > 	# Enables the unit on first installation, creates new
> > 	# symlinks on upgrades if the unit file has changed.
> > 	deb-systemd-helper enable winbind.service >/dev/null || true
> > 
> > If it isn't being treated as 'new' install, then the 
> 'winbind.service'
> > file is installed but not enabled.
> > 
> > If the 'postinst' script is run with 'configure' (which it probably
> > is) then this is run:
> > 
> > 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
> > 
> > So, as 'winbind' tries to be started on a DC, at least one of the 
> > above is being run. Shouldn't the script check if smb.conf has been 
> > set up as a DC and not do either if it has ?
> > 
> > Rowland
> >  
> > 
> > --
> > To unsubscribe from this list go to the following URL and read the
> > instructions:  https://lists.samba.org/mailman/options/samba
> > 
> 
> 
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
> 




More information about the samba mailing list