An approach to solving the 'different paths' upgrade problem

Andrew Bartlett abartlet at
Sat Aug 20 06:47:52 MDT 2011

On Sat, 2011-08-20 at 14:03 +0200, Jelmer Vernooij wrote:
> On Sat, Aug 20, 2011 at 06:43:25PM +1000, Andrew Bartlett wrote:
> > I've been thinking about the issue with upgrading Samba4 into a
> > different prefix.  Currently upgrade_from_s3 is rather clunky in this
> > case. 
> > My proposed solution uses this command:
> > testparm --parameter-name='netbios name' -l -s 2> /dev/null
> > This works not only for netbios name, but also for state dir, private
> > dir etc.  It returns the option, even if the smb.conf doesn't set it -
> > it was added by Debian for distro-specific scripting around smb.conf
> > specified paths. 
> > From this, we can extract all the parameters we need.  The advantage
> > here is that we won't be using the Samba 4.0 testparm or loadparm system
> > - we will have the user point us at the old testparm (with
> > --old-testparm=), which will be compiled against the correct paths.
> > We can then load this into the loadparm system using param.set_option(),
> > or pass it to provision etc. 
> I'm not sure I understand all the parameters here, but wouldn't it be
> possible to just point the generic smb.conf parser at that file and
> use that to retrieve the options?

No, we can't use any kind of generic parser because we need to know the
default values.  (That's the same issue we have with using the s3 parser
in-process).  By using the previous testparm binary, we get the previous
installation's default directories.

We need that, because most RPM (for example) installations don't specify
all the directories in the smb.conf:  the defaults are already
reasonable, but a Samba4 install from source will have different paths. 

Of course 'packaged' upgrades won't have this issue, and so won't use
this option.

Andrew Bartlett

Andrew Bartlett                      
Authentication Developer, Samba Team 

More information about the samba-technical mailing list