Samba 2.0.7 and FHS conventions

Dave O'Neill doneill at linuxcare.com
Fri Jan 26 17:47:32 GMT 2001


On Tue, 23 Jan 2001, Daniel Roethlisberger wrote:

> Short Version:
>  Why don't you comply with the Filesystem Hierarchy Standard? [1]

Okay, sure.  =)

Here's a patch that takes care of the simple stuff in configure.in and
Makefile.in.  It adds an --enable-fhs-compliance flag to configure that
will do the following:
   - SBINDIR becomes ${exec_prefix}/sbin
   - VARDIR becomes /var
   - logfiles go to $(VARDIR)/log/samba
   - printers.def and codepages directory go under ${prefix}/share/samba
   - SWAT html and images go under ${prefix}/share/swat
   - PRIVATEDIR becomes $(VARDIR)/state/samba/private
   - LOCKDIR becomes $(VARDIR)/state/samba/locks  (for now... see below)
   - configfiles go under /etc

Without the --enable-fhs-compliance flag, everything should end up where
it always has (though I haven't tested all possible combinations of
--with-XXXdir= , so there could be possible problems there).

LOCKDIR looks like a mess to me, so this patch doesn't do much with it
besides stick it in a more FHS-friendly place.  I was thinking that the
pidfiles belong in /var/run/, and the tdb files belong somewhere like
/var/state/samba/data or somesuch.

Any suggestions?  Comments?

Dave
-- 
Dave O'Neill,    Senior Linux Consultant,     Linuxcare, Inc.
desk: (613) 562-9949 fax: (613) 562-9700 cell: (613) 223-0219
doneill at linuxcare.com               http://www.linuxcare.com/

-------------- next part --------------
diff -u -p -r1.252 Makefile.in
--- Makefile.in	2001/01/23 17:32:47	1.252
+++ Makefile.in	2001/01/26 17:10:45
@@ -5,7 +5,6 @@
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-mandir=@mandir@
 
 LIBS=@LIBS@
 CC=@CC@
@@ -27,39 +26,71 @@ top_builddir=.
 SHELL=/bin/sh
 
 BASEDIR= @prefix@
+
+## Where user binaries should go.  
 BINDIR = @bindir@
-# we don't use sbindir because we want full compatibility with
-# the previous releases of Samba
-SBINDIR = @bindir@
+
+## Where system binaries should go.
+## Legacy location is ${exec_prefix}/bin.  FHS location is ${exec_prefix}/sbin
+SBINDIR = @sbindir@
+
+## Where shared libs go.
+## Legacy location is ${exec_prefix}/lib.  FHS location is ${exec_prefix}/lib
 LIBDIR = @libdir@
+
+## Where logfiles, state information, etc goes.
+## Legacy location is ${prefix}/var.  FHS location is /var/
 VARDIR = @localstatedir@
+
+## Where manpages go.
+## Legacy location is ${prefix}/man.  FHS loation is ${prefix}/man
 MANDIR = @mandir@
 
+## Where logfiles go.  
+## Legacy location is ${prefix}/var.  FHS location is /var/log/samba/
+LOGDIR = @logdir@
+
+## Where static data files go.
+## Legacy location is ${prefix}/lib.   FHS location is ${prefix}/share/samba
+SHAREDIR = @sharedir@
+
+## This is where SWAT images and help files go
+## Legacy location is ${prefix}/swat.  FHS location is ${prefix}/share/swat
+SWATDIR = @swatdir@
+
+## Where dynamic data filesc go.
+## Legacy location is ${prefix}.  FHS location is $(VARDIR)/state/samba
+STATEDIR = @statedir@
+
+## the directory where lock files go
+## Legacy location is $(VARDIR)/locks.  FHS location is /var/state/samba/locks 
+LOCKDIR = $(STATEDIR)/locks
+
+
+# This is where smbpasswd et al go
+# Legacy location is ${prefix}/private.  FHS location is /var/state/samba/private.
+PRIVATEDIR = $(STATEDIR)/private
+
+## Where config files go.
+## Legacy location is $(LIBDIR).  FHS location is /etc
+ETCDIR = @sysconfdir@
+
 # The permissions to give the executables
 INSTALLPERMS = 0755
 
 # set these to where to find various files
 # These can be overridden by command line switches (see smbd(8))
 # or in smb.conf (see smb.conf(5))
-LOGFILEBASE = $(VARDIR)
-CONFIGFILE = $(LIBDIR)/smb.conf
-LMHOSTSFILE = $(LIBDIR)/lmhosts
-DRIVERFILE = $(LIBDIR)/printers.def
+
+CONFIGFILE = $(ETCDIR)/smb.conf
+LMHOSTSFILE = $(ETCDIR)/lmhosts
+DRIVERFILE = $(SHAREDIR)/printers.def
 PASSWD_PROGRAM = /bin/passwd
-# This is where smbpasswd et al go
-PRIVATEDIR = @privatedir@
 
 SMB_PASSWD_FILE = $(PRIVATEDIR)/smbpasswd
-PRIVATE_DIR = $(PRIVATEDIR)
-
-# This is where SWAT images and help files go
-SWATDIR = @swatdir@
-
-# the directory where lock files go
-LOCKDIR = @lockdir@
 
 # The directory where code page definition files go
-CODEPAGEDIR = $(LIBDIR)/codepages
+CODEPAGEDIR = $(SHAREDIR)/codepages
 
 # The current codepage definition list.
 CODEPAGELIST= 437 737 775 850 852 861 932 866 949 950 936 1251 ISO8859-1 ISO8859-2 ISO8859-5 ISO8859-7 KOI-R 857 ISO8859-9
@@ -72,8 +103,8 @@ CODEPAGELIST= 437 737 775 850 852 861 93
 SMBRUN = $(BINDIR)/smbrun
 
 
-PASSWD_FLAGS = -DPASSWD_PROGRAM=\"$(PASSWD_PROGRAM)\" -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATE_DIR)\"
-FLAGS1 = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -DLOGFILEBASE=\"$(LOGFILEBASE)\"
+PASSWD_FLAGS = -DPASSWD_PROGRAM=\"$(PASSWD_PROGRAM)\" -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATEDIR)\"
+FLAGS1 = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -DLOGFILEBASE=\"$(LOGDIR)\"
 FLAGS2 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"  
 FLAGS3 = -DSWATDIR=\"$(SWATDIR)\" -DSBINDIR=\"$(SBINDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DSMBRUN=\"$(SMBRUN)\" -DCODEPAGEDIR=\"$(CODEPAGEDIR)\"
 FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DBINDIR=\"$(BINDIR)\" -DFORMSFILE=\"$(FORMSFILE)\" -DNTDRIVERSDIR=\"$(NTDRIVERSDIR)\"
diff -u -p -r1.139 configure.in
--- configure.in	2001/01/11 23:41:32	1.139
+++ configure.in	2001/01/26 17:10:46
@@ -1226,6 +1226,39 @@ if test x"$samba_cv_BROKEN_NISPLUS_INCLU
     AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
 fi
 
+##
+## Check if FHS-compliance is desired
+##
+AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard installation])
+AC_ARG_ENABLE(fhs-compliance,
+[  --enable-fhs-compliance     Enable Filesystem Hierarchy Standard (FHS) compliant installation],
+[ 
+if test "$enableval" = "yes" ; then
+  AC_MSG_RESULT(yes)
+  prefix='/usr/local'
+  sbindir='${prefix}/sbin'
+  localstatedir='/var'
+  logdir='${VARDIR}/log/samba'
+  sharedir='${prefix}/share/samba'
+  swatdir='${prefix}/share/swat'
+  statedir='${VARDIR}/state/samba'
+  lockdir='${STATEDIR}/locks'
+  sysconfdir='/etc'
+fi
+],[
+  AC_MSG_RESULT(no)
+  sbindir='${prefix}/bin'
+  localstatedir='${prefix}/var'
+  logdir='${prefix}/var'
+  sharedir='${prefix}/lib'
+  swatdir='${prefix}/swat'
+  lockdir='${VARDIR}/locks'
+  sysconfdir='${LIBDIR}'
+  statedir='${prefix}'
+])
+AC_SUBST(logdir)
+AC_SUBST(sharedir)
+AC_SUBST(statedir)
 
 #################################################
 # check for smbwrapper support


More information about the samba-technical mailing list