Proposed paths for Samba 4.0

Andrew Bartlett abartlet at samba.org
Tue Jun 21 01:30:49 MDT 2011


On Mon, 2011-06-20 at 14:46 -0400, simo wrote:
> On Mon, 2011-06-20 at 17:51 +0200, Stefan (metze) Metzmacher wrote:
> > Am 15.06.2011 11:35, schrieb Stefan (metze) Metzmacher:
> > > Hi Andrew,
> > > 
> > >> Attached is a patch to implement a new set of default paths for Samba
> > >> 4.0
> > >>
> > >> The challenge here is that the Samba4 branch historically chose a
> > >> different set of default paths to the release branches, and this needs
> > >> to be resolved before we release Samba 4.0
> > >>
> > >> The approach I have taken is:
> > >>
> > >>  - Users who install from source should keep key files in the same
> > >> places as 3.6
> > >>  - except for config files which are moved from lib/ to etc/
> > >>  - all the key paths can be configured, so distributions can put things
> > >> in the right place
> > >>
> > >> In doing this, I've removed --with-fhs as it didn't seem to work very
> > >> well (used on it's own, it produces paths under /usr/local/samba/, and
> > >> even combined with --prefix=/usr it created paths like /usr/etc
> > >> and /usr/var
> > > 
> > > I'm using
> > > 
> > >         --prefix=$DESTDIR/usr \
> > >         --sysconfdir=$DESTDIR/etc \
> > >         --localstatedir=$DESTDIR/var \
> > >         --enable-fhs \
> > > 
> > > and I guess that matches mostly what distros are using.

Firstly, I do wish to apologise for not getting this right with you
before I put the changes in. 

Sadly it does not match what any distro I've found uses, which is why I
attached the notes from my survey of major distro build scripts to a
previous mail.  I attach it again here.  In short, Fedora and OpenSUSE
don't use --enable-fhs, but debian does.  All distros specify most of
their paths in their spec files, and so it seemed futile to put great
efforts into an option that wasn't used by it's intended audience. 

> > > I think we should try to keep it that simple
> > > and hope that distros start to use the same.
> > 
> > Maybe I wasn't clear enough, this means I'm using --enable-fhs and
> > I want to keep using that option!
> > 
> > Please readd it, I want a simple option that makes sure
> > I'm using 'samba' subdirectories.

> > Removing this options means users have to think about all possible pathes
> > and specify them explicitly, which is ugly (at least for me).

I would appreciate input from both of you as to how our default paths
should behave, as we can't go back to the previous implementation (it
failed to set correct paths for Samba3's statedir and cachedir), and I
believe that --eanble-fhs isn't quite as simple as it sounds. 

I want to look at the problem from two perspectives, to try and hone in
on what we agree the best behaviours should be.  

The first is:  What should the defaults be in the --help?

Currently we show (this is a subset):
  --with-modulesdir=MODULESDIR
                        modules directory [PREFIX/modules]
  --with-privatelibdir=PRIVATELIBDIR
                        private library directory [PREFIX/lib/samba]
  --with-logfilebase=LOGFILEBASE
                        Where to put log files [${LOCALSTATEDIR}]
  --with-statedir=STATEDIR
                        where to put persistent state files
[${LOCALSTATEDIR}/locks]
  --with-pammodulesdir=PAMMODULESDIR
                        Which directory to use for PAM modules
[${LIBDIR}]
  --with-privatedir=PRIVATEDIR
                        Where to put sam.ldb and other private files
[${PREFIX}/private]
...
    --sysconfdir=SYSCONFDIR
                        read-only single-machine data [Default:
${PREFIX}/etc]
    --datarootdir=DATAROOTDIR
                        read-only arch.-independent data root [Default:
${PREFIX}/share]
    --datadir=DATADIR   read-only architecture-independent data
[Default: ${DATAROOTDIR}]

Clearly if we set --enable-fhs, a number of these should change.  Should
we print and use the normal defaults, but have it set other paths if
--enable-fhs is used?  Should we print both possible defaults?  I think
it is vital that a user be able to work out what our options do. 

We could define --enable-fhs to simply append samba to all the paths,
but then we find that distributions don't universally use the a 'samba'
suffix.  

For example, Fedora places the winbind pipe in /var/run/winbind, expects
the ntp_signd pipe in /var/run/ntp_signd, and has the pid file
in /var/run/smbd.pid

This all works well with the current --localstatedir=/var, but will need
to be overridden if --enable-fhs is set and 'samba' is placed in these
paths. 

The same can be said for --with-privatedir on debian, which is
in /etc/samba at the moment, but would be /var/lib/samba/private under
--enable-fhs (and shows we can't just append 'samba'). 

This also shows why we can't go back to the previous approach (before my
patch).  This approach was to force a standard set of paths instead of
the ones selected by the distro/user.  If any one of these paths needed
to be set, then on the previous modal --enable-fhs could not be used.

Finally, we already have so much variation between distributions that I
don't think it's possible to unscramble this egg.  I think we should
focus instead on having a sensible set of paths for the
default /usr/local/samba install, and then work with the distributions
to come up with the best possible compromise between their existing
paths and a standard 'Samba blessed' set of paths.

Perhaps we should make things easier for distributions by reducing the
number of paths?  Perhaps collapse 'state dir' and 'private dir' into
one directory or tree, and similarly collapse 'lock dir' and 'cache
dir'?  

I've already worked to collapse the sockets options into one
--with-sockets-dir for this reason, and likewise removed the swat dir. 

So, my question to you both is, given that we want to have a set of
behaviour that encourages a standard layout but which has behaviour that
we can explain to our users:

What exactly should --enable-fhs do?

Which paths should it change, what should they be changed to, and what
priority order (enable-fhs, gnu options, with options) should apply?

Thanks,

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
-------------- next part --------------

Top level WAF (default)
   SRCDIR:      /data/samba-2/source3
   BUILDDIR:    /data/samba-2/source3
   SBINDIR: /usr/local/samba/sbin
   BINDIR: /usr/local/samba/bin
   SWATDIR: /usr/local/samba/share/swat
   CONFIGFILE: /usr/local/samba/etc/smb.conf
   LOGFILEBASE: /usr/local/samba/var
   LMHOSTSFILE: /usr/local/samba/etc/lmhosts
   LIBDIR: /usr/local/samba/lib
   MODULESDIR: /data/samba-2/bin/modules
   LOCKDIR: /usr/local/samba/var/locks
   STATEDIR: /usr/local/samba/var
   CACHEDIR: /usr/local/samba/var/locks
   PIDDIR: /usr/local/samba/var/run
   SMB_PASSWD_FILE: /usr/local/samba/private/smbpasswd
   PRIVATE_DIR: /usr/local/samba/private

Top level WAF --prefix=/usr --enable-fhs
   SRCDIR:      /data/samba-2/source3
   BUILDDIR:    /data/samba-2/source3
   SBINDIR: /usr/sbin
   BINDIR: /usr/bin
   SWATDIR: /usr/share/swat
   CONFIGFILE: /usr/etc/samba/smb.conf
   LOGFILEBASE: /usr/var/log/samba
   LMHOSTSFILE: /usr/etc/samba/lmhosts
   LIBDIR: /usr/lib
   MODULESDIR: /data/samba-2/bin/modules
   LOCKDIR: /usr/var/lib/samba
   STATEDIR: /usr/var
   CACHEDIR: /usr/var/locks
   PIDDIR: /usr/var/run/samba
   SMB_PASSWD_FILE: /usr/private/smbpasswd
   PRIVATE_DIR: /usr/var/lib/samba/private

Samba3 autoconf --prefix=/usr --with-fhs
Paths:
   SBINDIR: /usr/sbin
   BINDIR: /usr/bin
+  SWATDIR: /usr/share/samba/swat
   CONFIGFILE: /usr/etc/samba/smb.conf
   LOGFILEBASE: /usr/var/log/samba
   LMHOSTSFILE: /usr/etc/samba/lmhosts
   LIBDIR: /usr/lib
   MODULESDIR: /usr/lib/samba
   SHLIBEXT: so
   LOCKDIR: /usr/var/lib/samba
*  STATEDIR: /usr/var/lib/samba
*  CACHEDIR: /usr/var/lib/samba
*  PIDDIR: /usr/var/run
*  SMB_PASSWD_FILE: /usr/etc/samba/private/smbpasswd
*  PRIVATE_DIR: /usr/etc/samba/private

Samba3 autoconf default paths
Paths:
   SBINDIR: /usr/local/samba/sbin
   BINDIR: /usr/local/samba/bin
   SWATDIR: /usr/local/samba/swat
   CONFIGFILE: /usr/local/samba/lib/smb.conf
   LOGFILEBASE: /usr/local/samba/var
   LMHOSTSFILE: /usr/local/samba/lib/lmhosts
   LIBDIR: /usr/local/samba/lib
   MODULESDIR: /usr/local/samba/lib
   SHLIBEXT: so
   LOCKDIR: /usr/local/samba/var/locks
   STATEDIR: /usr/local/samba/var/locks
   CACHEDIR: /usr/local/samba/var/locks
   PIDDIR: /usr/local/samba/var/locks
   SMB_PASSWD_FILE: /usr/local/samba/private/smbpasswd
   PRIVATE_DIR: /usr/local/samba/private

OpenSUSE Factory 3.5.8 
./autogen.sh
CONFIGURE_OPTIONS="\
	--prefix=%{_prefix} \
	--localstatedir=%{LOCKDIR} \
	--sysconfdir=%{CONFIGDIR} \
	--with-configdir=%{CONFIGDIR} \
	--libdir=%{_libdir} \
	--with-lockdir=%{LOCKDIR} \
	--with-logfilebase=%{LOGDIR} \
	--with-mandir=%{_mandir} \
	--with-modulesdir=%{_libdir}/samba \
	--with-rootsbindir=/sbin \
	--enable-cups \
	--enable-debug \
%if %{link_static_libs}
	--enable-static \
%else
	--disable-static \
%endif
	--with-acl-support \
	--with-automount \
	--with-dnsupdate \
	--with-pam \
	--with-pammodulesdir=%{_lib}/security \
	--with-pam_smbpass \
	--with-piddir=%{PIDDIR} \
	--with-privatedir=%{CONFIGDIR} \
%if %{make_devel}
	--with-profiling-data \
%endif
	--with-quotas \
	--with-swatdir=%{SWATDIR} \
	--with-syslog \
	--with-utmp \
	--with-winbind \
	--with-shared-modules=%{vfs_modules},%{idmap_modules} \
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1120
	--without-cifsmount \
%else
	--with-cifsumount \
%endif
%if %{make_cifsupcall} == 0
	--without-cifsupcall \
%else
	--with-cifsupcall \
%endif
%if %{make_devel}
	--enable-developer \
	--enable-krb5developer \
%endif

Fedora 3.6.0:

CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -DLDAP_DEPRECATED" %configure \
    --with-dnsupdate \
    --with-ads \
    --with-acl-support \
    --with-automount \
    --with-dnsupdate \
    --with-libsmbclient \
    --with-libsmbsharemodes \
    --with-mmap \
    --with-pam \
    --with-pam_smbpass \
    --with-quotas \
    --with-sendfile-support \
    --with-syslog \
    --with-utmp \
    --with-vfs \
    --with-winbind \
    --without-smbwrapper \
    --with-lockdir=/var/lib/samba \
    --with-piddir=/var/run \
    --with-mandir=%{_mandir} \
    --with-privatedir=/var/lib/samba/private \
    --with-logfilebase=/var/log/samba \
    --with-libdir=%{_libdir} \
    --with-modulesdir=%{_libdir}/samba \
    --with-configdir=%{_sysconfdir}/samba \
    --with-pammodulesdir=%{_lib}/security \
    --with-swatdir=%{_datadir}/swat \
    --with-shared-modules=idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2 \
    --with-cluster-support=auto \
    --with-libtalloc=no \
    --enable-external-libtalloc=yes \
    --with-libtdb=no
#    --enable-external-libtdb=yes \
#    --with-aio-support \

Debian:

conf_args = \
		--cache-file=./config.cache \
		--with-fhs \
		--enable-shared \
		--enable-static \
		--prefix=/usr \
		--sysconfdir=/etc \
		--libdir=/usr/lib/samba \
		--with-privatedir=/etc/samba \
		--with-piddir=/var/run/samba \
		--localstatedir=/var \
		--with-rootsbindir=/sbin \
		--with-pammodulesdir=/lib/security \
		--with-pam \
		--with-syslog \
		--with-utmp \
		--with-readline \
		--with-pam_smbpass \
		--with-libsmbclient \
		--with-winbind \
		--with-shared-modules=idmap_rid,idmap_ad,idmap_adex,idmap_hash,idmap_ldap,idmap_tdb2 \
		--with-automount \
		--with-ldap \
		--with-ads \
		--with-dnsupdate \
		--without-libtdb \
		--without-libnetapi \
		--with-modulesdir=/usr/lib/samba \
		--datarootdir=/usr/share \
		--datadir=/usr/share/samba \
		--with-swatdir=/usr/share/samba/swat \
		--with-lockdir=/var/run/samba \
		--with-statedir=/var/lib/samba \
		--with-cachedir=/var/cache/samba \
		--with-codepagedir=/usr/share/samba \
		--with-nmbdsocketdir=/var/run/samba \
		--enable-external-libtalloc \
		--without-libtalloc \
		--disable-avahi


More information about the samba-technical mailing list