Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Fwd: Samba 2.0.7 and FHS conventions]

28 views
Skip to first unread message

Gerald Carter

unread,
Jan 23, 2001, 6:56:49 PM1/23/01
to
Anyone want to respond?

-------- Original Message --------
Subject: Samba 2.0.7 and FHS conventions
Date: Wed, 24 Jan 2001 00:50:54 +0100
From: Daniel Roethlisberger <ad...@roe.ch>
To: sa...@us5.samba.org

Hi there,

[I'm not subscribed to the list, if you want me to know what you
reply please CC me]


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

Very Long Version:

In the process of building a linux box from scratch, I've
recently built samba-2.0.7 . It seems to me that the autoconf
defaults do not follow the Filesystem Hierarchy Standard at all.
Even worse, it is not even possible to make it follow the FHS
convention by mere command line arguments. My best try was:

./configure --prefix=/usr \
--sysconfdir=/etc \
--libdir=/etc \
--localstatedir=/var \
--with-privatedir=/etc/samba \
--with-lockdir=/var/samba \
--with-swatdir=/usr/lib/swat

But that was not enough - log files go to /var/log, not
/var - so I edited Makefile.in, and made some changes:

-SBINDIR = @bindir@
+SBINDIR = @sbindir@

+ETCDIR = @etcdir@

-SMBLOGFILE = $(VARDIR)/log.smb
+SMBLOGFILE = $(VARDIR)/log/smb.log
-NMBLOGFILE = $(VARDIR)/log.nmb
+NMBLOGFILE = $(VARDIR)/log/nmb.log
-CONFIGFILE = $(LIBDIR)/smb.conf
+CONFIGFILE = $(ETCDIR)/smb.conf
-LMHOSTSFILE = $(LIBDIR)/lmhosts
+LMHOSTSFILE = $(ETCDIR)/lmhosts
-DRIVERFILE = $(LIBDIR)/printers.def
+DRIVERFILE = $(ETCDIR)/printers.def

This also moved the configuration files to etc instead of lib,
which makes the --libdir=/etc switch to configure obsolete.
Great.

However, the pid files still were not at the correct place. To
fix that, I even had to apply a quick-and-dirty hack to
source/lib/pidfile.c:

- slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_lockdir(), name);
+ slprintf(pidFile, sizeof(pidFile)-1, "/var/run/%s.pid", name);
(twice)

Only now my Samba installation complied with the Filesystem
Hierarchy Standard.

Here's what humble me considers harmful:
- You use LIBDIR for files that should go to ETCDIR

Here's what humble me considers bad practice:
- You put logfiles into VARDIR instead of VARDIR/log
- You put pidfiles into LOCKDIR instead of VARDIR/run

Here's what humble me considers not ok:
- You put system binaries into BINDIR instead of SBINDIR
- The defaults for privatedir, lockdir and swatdir are cluttering
the filesystem with stuff that should go elsewhere. Privatedir
is configuration, with similar content as /etc/shadow, so that
should go somewhere under /etc, Swatdir should clearly go to
PREFIX/lib/(package_name), ..)

I am aware that what I label "not ok" is due to historical
reasons, but why cling to historical locations, when at the same
time almost everybody else is trying hard to conform to the FHS?
At least the user can choose, so it's not -too- bad.

What I'd consider good practice is the following:
- Use ETCDIR instead of LIBDIR for config files.
(no need for additional switches - LIBDIR is IMHO just harmful)
- Use VARDIR/log for logfiles
(or at least let the user affect this with an autoconf switch)
- Use VARDIR/run for pidfiles
(or at least let the user affect this with an autoconf switch)
- Add a autoconf option like "--compatibility", which will make
autoconf use all those historical default paths. If not
specified, use more up-to-date defaults.
(or if you're really clinging to the old days, add an option
like "--comply-with-standards" and do this the other way
'round)


If this was fixed in the CVS or beta releases of Samba, please
forgive me (and let me know..;).

All this is just my 5 cents worth. And of course only how I and
everybody I talked to interpret the FHS. Let me know about your
interpretation of it, if it is completely different.

Well, just think about it. This is not a holy crusade... ;-)

Cheers,
Dan

References:
[1] Filesystem Hierarchy Standard - http://www.pathname.com/fhs/


--
Daniel Roethlisberger
PGP Key ID 0x8DE543ED

Mayers, Philip J

unread,
Jan 24, 2001, 8:25:19 AM1/24/01
to
This is a common complaint - *every* package patches the makefile. The Linux
FHS is a *good* setup, and I'd cheer if Samba's Makefile was fixed. Of
course, it doesn't just run on Linux, but...

/usr/local/samba/lib/smb.conf

That's just broken.

Regards,
Phil

+----------------------------------+
| Phil Mayers, Network Support |
| Centre for Computing Services |
| Imperial College |
+----------------------------------+

-----Original Message-----
From: Gerald Carter [mailto:gca...@valinux.com]
Sent: 23 January 2001 23:56
To: samba-t...@samba.org
Subject: [Fwd: Samba 2.0.7 and FHS conventions]


Anyone want to respond?

Richard Sharpe

unread,
Jan 24, 2001, 8:34:23 AM1/24/01
to
At 01:24 PM 1/24/01 +0000, Mayers, Philip J wrote:
>This is a common complaint - *every* package patches the makefile. The Linux
>FHS is a *good* setup, and I'd cheer if Samba's Makefile was fixed. Of
>course, it doesn't just run on Linux, but...
>
>/usr/local/samba/lib/smb.conf
>
>That's just broken.

Well, no, it's not broken on Digital UNIX, Solaris, HP/UX etc ... Only on
Linux.

Perhaps the locations of all these places should be pulled in via some
include file included into the Makefile.

>Regards,
>Phil
>
>+----------------------------------+
>| Phil Mayers, Network Support |
>| Centre for Computing Services |
>| Imperial College |
>+----------------------------------+
>
>-----Original Message-----
>From: Gerald Carter [mailto:gca...@valinux.com]
>Sent: 23 January 2001 23:56
>To: samba-t...@samba.org
>Subject: [Fwd: Samba 2.0.7 and FHS conventions]
>
>
>Anyone want to respond?
>
>

Regards
-------
Richard Sharpe, sha...@ns.aus.com
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba

Kevin Colby

unread,
Jan 24, 2001, 11:40:05 AM1/24/01
to
"Mayers, Philip J" wrote:
>
> This is a common complaint - *every* package patches the makefile. The Linux
> FHS is a *good* setup, and I'd cheer if Samba's Makefile was fixed. Of
> course, it doesn't just run on Linux, but...
>
> /usr/local/samba/lib/smb.conf
>
> That's just broken.

I must admit the use of lib/ in this manner has disturbed me for years.
Didn't even HP-UX ditch this with version 10?

- Kevin Colby
kev...@grainsystems.com

Tim Potter

unread,
Jan 24, 2001, 12:35:16 PM1/24/01
to
Richard Sharpe writes:

> Perhaps the locations of all these places should be pulled in via some
> include file included into the Makefile.

How about a --with-linux-fhs configure option that just sets
appropriate values for all the other configuration parameters?


Tim.


Cole, Timothy D.

unread,
Jan 24, 2001, 12:56:15 PM1/24/01
to
FHS isn't Linux-specific, nor can you currently get complete FHS compliance
just by setting Samba's autoconf variables.

[ from the original message:

Even worse, it is not even possible to make it follow the FHS
convention by mere command line arguments. My best try was:

./configure --prefix=/usr \
--sysconfdir=/etc \
--libdir=/etc \
--localstatedir=/var \
--with-privatedir=/etc/samba \
--with-lockdir=/var/samba \
--with-swatdir=/usr/lib/swat

[ assorted Makefile.in and source code changes required for FHS-compliance
omitted ]

]

To be honest, Samba's weird conventions have bothered me (and many other
sysadmins) for a long time. Maybe 2.2 would be a good place to change them.

David Collier-Brown

unread,
Jan 24, 2001, 2:11:19 PM1/24/01
to
Tim Potter wrote:
> How about a --with-linux-fhs configure option that just sets
> appropriate values for all the other configuration parameters?

Methinks use of the Linux FHS should (just) be the
default for Linux.

--dave (on Solaris)
--
David Collier-Brown, | Always do right. This will gratify
Performance & Engineering Team | some people and astonish the rest.
Americas Customer Engineering | -- Mark Twain
(905) 415-2849 | dav...@canada.sun.com

David Lee

unread,
Jan 25, 2001, 5:15:17 AM1/25/01
to
On Thu, 25 Jan 2001, Tim Potter wrote:

> Richard Sharpe writes:
>
> > Perhaps the locations of all these places should be pulled in via some
> > include file included into the Makefile.
>

> How about a --with-linux-fhs configure option that just sets
> appropriate values for all the other configuration parameters?

Careful with that "linux"-ism. From an initial reading of the FHS
document, it is of far wider benefit than merely Linux. For example it
seems also highly applicable to Solaris, and they seem to have taken
soundings from a wide range of OSes. (Sure, there will be details to
quibble over, but I suspect that at least 95% could be highly applicable
across the range, and the remaining 5% at least of background benefit.)

GNU autoconf has certain ideas about installation locations. The FHS
paper seems to be philosophically aligned with those of GNU autoconf
(again at the 95% level).

The Samba config uses GNU's autoconf, but often seems to go against the
GNU recommendations.

If we were taking a vote on whether to consider bringing Samba into line
with GNU and/or FHS (in principle), I would definitely be in favour.
(Our site runs several integrated Solaris samba servers with upwards of
800 simultaneous connections.)

Perhaps someone from the core Samba Team could say whether the *principle*
of alignment with GNU (and/or FHS) would at least be considered or not.
If so, then those of us in favour would know it would be worth pursuing
and coming up with the practical suggestions.

--

: David Lee I.T. Service :
: Systems Programmer Computer Centre :
: University of Durham :
: http://www.dur.ac.uk/t.d.lee/ South Road :
: Durham :
: Phone: +44 191 374 2882 U.K. :


David Lee

unread,
Jan 25, 2001, 5:19:16 AM1/25/01
to
On Wed, 24 Jan 2001, David Collier-Brown wrote:

> Tim Potter wrote:
> > How about a --with-linux-fhs configure option that just sets
> > appropriate values for all the other configuration parameters?
>

> Methinks use of the Linux FHS should (just) be the
> default for Linux.

The mention of the L-word (in "--with-linux-fhs") has thrown us off
course. FHS appears to be multi-system, and, as with the GNU autoconf
defaults, a reasonable starting point for a wide range of OSes, whether
System-V based, BSD-based or whatever...

(Let's forget that the L-word was ever mentioned on this thread.)

Gerald Carter

unread,
Jan 25, 2001, 9:14:21 AM1/25/01
to
David Lee wrote:
>
> Perhaps someone from the core Samba Team could say
> whether the *principle* of alignment with GNU (and/or
> FHS) would at least be considered or not. If so, then those
> of us in favour would know it would be worth pursuing
> and coming up with the practical suggestions.

My feeling is that the current file locations is steeped
in historical precedence. We've always done it that way :)
Any change at this point would probably be ok as long as
it does not break existing installations.

For my two cents, when I was a sysadmin at a university,
For 2.0.x, I always ran

# ./configure --prefix=/usr/samba
# cp -p bin/?mbd /usr/samba/bin
# ln -s /usr/samba/lib/smb.conf /etc

and way pretty happy with it. Now as a developer, I love
having everything in one place (/usr/local/samba) 'cause
I always end up blowing the directory away a couple time a
day. :-) No messy cleanup :-)

btw...All compiled software should go in /usr/local/.
A config file in /etc is fine. But binaries IMO should be
in /usr/local/ (not /usr). Just my IMO as a sysadmin
and developer.

[quickly covers in flame-proof shirt and shorts...]


Cheers, jerry
----------------------------------------------------------------------
/\ Gerald (Jerry) Carter Professional Services
\/ http://www.valinux.com/ VA Linux Systems gca...@valinux.com
http://www.samba.org/ SAMBA Team je...@samba.org
http://www.plainjoe.org/ je...@plainjoe.org

"...a hundred billion castaways looking for a home."
- Sting "Message in a Bottle" ( 1979 )

Tim Potter

unread,
Jan 25, 2001, 12:49:19 PM1/25/01
to
David Lee writes:

> > How about a --with-linux-fhs configure option that just sets
> > appropriate values for all the other configuration parameters?
>

> Careful with that "linux"-ism. From an initial reading of the FHS
> document, it is of far wider benefit than merely Linux. For example it

Up till now I was mistakenly assuming the RHS was linux only.
Now I am no longer! (-:

> Perhaps someone from the core Samba Team could say whether the *principle*
> of alignment with GNU (and/or FHS) would at least be considered or not.
> If so, then those of us in favour would know it would be worth pursuing
> and coming up with the practical suggestions.

I think it's definitely a good idea.


Regards,

Tim.


Jeremy Allison

unread,
Jan 29, 2001, 1:10:45 PM1/29/01
to
David Lee wrote:
>
> Perhaps someone from the core Samba Team could say whether the *principle*
> of alignment with GNU (and/or FHS) would at least be considered or not.
> If so, then those of us in favour would know it would be worth pursuing
> and coming up with the practical suggestions.

Yes we definately want to move towards this - we wanted
to originally with 2.2 but it's probably a little late
for the .0 release.

However the main desire is that people can upgrate their
older installations with no problems. That's the magic
key to allowing this.....

Jeremy.

--
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------

0 new messages