Development/Docs/FHS
From Mandriva
This document summarizes the discrepancies between the Mandriva Linux Cooker circa the Mandriva Linux 2005 release and the Filesystem Hierarchy Standard version 2.3.
Introduction
The FHS
The Filesystem Hierarchy Standard is a set of filesystem layout requirements and recommendations for a minimal UNIX-like system, in order to "support interoperability of applications, system administration tools, development tools, and scripts as well as greater uniformity of documentation for these systems." The FHS is part of the Linux Standard Base specification, and its last release is version 2.3 (released January 29th, 2004).
This document compares the current state of Cooker (May 2005) with the FHS 2.3 requirements and guidelines, highlighting differences that should be addressed prior to the Mandriva Linux 2006 release. This survey is not exhaustive and was conducted in a minimally installed system, other problems may exist that are not mentioned in the document.
Caveats
This excercise was performed without the LSB compatibility package installed. Although FHS is part of LSB, it extends to systems other than Linux and should be regarded as an interoperability standard bridging different Operating Systems and is not subordinated to the LSB.
The X/Open FHS conformance test was performed on my desktop workstation, onto which I had already created /media -- hence the absence of the error report on this required directory. Several other discrepancies, however, were not reported by the FHS conformance test suite.
References
- The FHS 2.3.
FHS 2.3 discrepancies
Root filesystem
Section 3.2: Requirements
- /media missing
- /srv missing
Section 3.7.2: /etc requirements
- /etc/opt missing
Section 3.11: Mount point for removable media
- /media missing.
Section 3.12: Temporary mount point
- System use of /mnt.
- /mnt has predefined content.
Section 3.16: Data for provided services
- /srv missing.
Section 3.17: Temporary files
- RECOMMENDATION: "It is recommended that files and directories located in /tmp be deleted whenever the system is booted." Mandriva Linux cleans up /tmp selectively.
/usr hierarchy
Section 4.3: Optional directories
- /usr/etc is neither a required nor an optional directory
Section 4.4: X11R6 hierarchy
- Many foreign binaries under /usr/X11R6/bin should be in /usr/bin, including several X applications that are not part of X11R6 (e.g. window managers, xscreensaver)
Section 4.5.2: /usr/bin specific options
- /usr/bin/X11 must be a symlink to /usr/X11R6/bin (Mandriva Linux links to ../X11R6/bin)
Section 4.6.2: /usr/include specific options
- /usr/include/X11 must be a symlink to /usr/X11R6/include/X11 (Mandriva Linux links to ../X11R6/include/X11)
Section 4.7.2: /usr/lib specific options
- /usr/lib/sendmail should be a symlink to /usr/sbin/sendmail (see AlternativesPolicyReview for details)
Section 4.8.2: /usr/local hierarchy
- /usr/local/man missing (should be a symlink to /usr/local/share/man)
- /usr/local/doc shouldn't exist
- /usr/local/libexec shouldn't exist
- /usr/local/share/misc missing
Section 4.11.6: files in /usr/share/misc
- termcap should be here
/var hierarchy
Section 5.7: Variable game data
- Moved from /var/lib/games to /var/games, Mandriva Linux is using the old location.
Section 5.13.2: /var/run requirements
- vtun.pid in wrong format, missing ending newline
- xfs.pid in wrong format, starts with space
Miscelaneous problems
Misplaced configuration files
- Smart places configuration files under /var/lib instead of /etc (but binary configuration files are forbidden in /etc so it's OK if we consider it as its state and not a config file)
- OpenOffice.org places psprint.conf under /usr/lib
Bug #10022
- OpenSSL places openssl.cnf under /usr/lib
Bug #12912
Summary
In this document we compared a minimally installed Mandriva Linux Cooker, as it was in May 2005, to the FHS 2.3 standard released in January 2004. The comparison was made through manual inspection of the standard and a newly installed system, and a number of discrepancies have been found -- most notably a difference in the root filesystem layout regarding removable media and served content.
Interestingly, the X/OPEN Verification Suite for FHS 2.3 compliance didn't catch most of the discrepancies above, only complaining about the missing /srv and /etc/opt. It would be good, however, to fix other known issues such as the /mnt vs /media, remove extra directories such as /usr/etc and /usr/local/libexec and use a more straightforward policy for /tmp cleaning. The relevant parts of the test report are listed below.
/tset/LSB.fhs/root/etc-opt/etc-opt-tc 1 Failed Test Information: Reference 3.7.2-1(A) The /etc/opt directory exists and is searchable /etc/opt: directory not found exit code 1 returned, expected 0
/tset/LSB.fhs/root/srv/srv-tc 1 Failed Test Information: Reference 3.16-1(A) The /srv directory exists and is searchable /srv: directory not found exit code 1 returned, expected 0