Chapter 2
SuSE and the File System Hierarchy Standard (FHS)
|
|
|
|
|
|
In this chapter: |
|
|
|
|
Traveling through the file system on your SuSE installation
|
|
Learning about the File System Hierarchy Standard
|
|
Understanding where and why SuSE violates the FHS
|
|
Finding the right location for several file and data types within the system
|
|
|
|
|
|
In Chapter 1, you saw that the file system tree is quite
structured. You learned about parts that are shareable or local,
static or variable. This chapter provides a short overview of the
entire file system and show why several parts of the tree have these
particular properties.
There's an ongoing project whose mission is to define a standard for
the file system hierarchy on Linux systems. The project began in 1993
with an effort to restructure the file and directory structure of
Linux. The first "File System Standard" (FSSTND) was released in
February 1994. In early 1995, the goal of the project changed. Its new
goal is to define a more comprehensive standard that addresses not only
Linux but also other Unix-like systems. The project's name was changed
to "File System Hierarchy Standard," or FHS.
The scope of the project is to specify the location of files and
directories and the contents of some file systems. The targeted
audience consists of system developers, system integrators and
distributors, application developers, documentation writers, system
administrators, and anyone with a strong interest in the topic.
In this chapter we walk you through the file system, show what the FHS
intends each part to look like, and survey what SuSE developers did to
implement this, or where they opted to do it differently. For the most
part, SuSE is FHS compliant. There are some minor points on which SuSE
developers decided to differ from FHS for compatibility reasons with
its older versions. SuSE gets closer to the FHS with every new release,
and it is SuSE's goal to provide a full FHS compliant system in the
near future.
|
2.1 | The Root Directory |
|
The root directory is the most important part of the whole
system. During the boot process, this file system is mounted first and
has to hold everything to bring the system to life. This requires
certain things to be on this file system:
|
|
|
Start-up data and utilities to set up the system configuration.
|
|
All utilities needed to mount other file systems. In a networked
environment, this may include the network utilities, as mounts may be
made over NFS.
|
|
Tools to repair broken file systems in order to perform a recovery
after a system crash. In particular, this means utilities to restore
backups from tapes, floppy disks, and other media.
|
|
|
On the other hand, the administrator's goal is to keep the root file
system as small as possible. The smaller a file system is, the less
likely it is to be corrupted in case of a system crash. The root file
system holds essential utilities as well as major system configuration
data in /etc, which means that it's not shareable. A
small root file system means less required hard disk space
in environments where as much data as possible is shared over a local
network.
Figure 2-1
shows the important parts of the file system
hierarchy in a SuSE Linux system. Directories that have to be present
at the root file system are underlined, and directories that are good
candidates for mount points are set in italic.
|
Figure 2-1 |
|
| The file system hierarchy |
|
Software should never create or require files or subdirectories in the
root directory. The FHS provides other places to put config files,
libraries, binaries, log files, and so on. Table 2-1
shows the
subdirectories in / and gives an overview of their
contents, and the sections that follow explain them in detail.
|
Table 2-1 |
Top-level directories of SuSE Linux |
|
Subdirectory |
Contents |
/bin |
Essential command binaries |
/boot |
Static files of the boot loader and the Linux kernel |
/cdrom |
Mount point of CD-ROMs |
/dev |
Special device files |
/etc |
Host specific system configuration |
/home |
User home directories |
/lib |
Essential shared libraries and kernel modules |
/mnt |
Mount point of temporary partitions |
/opt |
Add-on application software packages |
/proc |
Kernel information and configuration |
/root |
Home directory for the root user |
/sbin |
Essential system binaries |
/tmp |
Temporary files |
/usr |
Secondary hierarchy |
/var |
Variable data |
|
|
|
2.1.1 | /bin: Essential command binaries |
|
The subdirectory /bin contains commands that may be used
by the system administrator, or users,and that request a single-user
mode. It also contains commands that are used indirectly by
scripts. There are no subdirectories in /bin. On a
typical SuSE Linux system, /bin contains the commands shown in the
following list.
|
| arch dd gzip netstat su
ash df hostname nisdomainname sync
awk dmesg kill passwd tar
basename dnsdomainname ksh ping tcsh
bash domainname ln ps touch
bash1 echo login pwd true
cat egrep ls rm umount
chgrp false mail rmdir umssync
chmod fillup mkdir rpm uname
chown fuser mknod sash uncompress
compress gawk mktemp sed ypdomainname
cp grep more sh zcat
csh gtar mount sleep
date gunzip mv stty
|
|
|
2.1.2 | /boot: Static files of the boot loader and the Linux kernel |
|
/boot contains everything that is required for the first
stage of the boot process. The /boot directory stores
data that is needed before the kernel begins executing user mode
programs. It also holds backup copies of the boot records, sector map
files, and other items that are not edited manually. Programs that
access this data (mainly lilo) are located in /sbin, and
their configuration files are in /etc.
On SuSE systems with release 6.0, the Linux kernel is also located in
/boot. The Linux kernel makefile doesn't reflect this
yet. The command make zlilo, which may be used to create a new kernel
image and install it in the system, still places the kernel in the
root directory. Placing it in /boot is a good idea on
systems on which this directory is on a separate partition. In this
case, the root file system may be located above the 1023 cylinder mark
of the hard drive. Because of limitations in Intel PC BIOSes, the
contents of /boot have to be below this mark in order to
be accessible by the BIOS when the system is booted. If the whole root
directory is below this mark, there is no need to have a separate
partition for /boot, yet we highly recommend that you do,
because the Linux Loader lilo won't work; it simply can't access the
kernel image on the hard disc.
|
|
You can find more about the boot process in Chapters 5
,
6
,
and 7
.
|
|
|
2.1.3 | /cdrom: Mount point of CD-ROMs |
|
In spite of the fact that the FHS doesn't list the /cdrom
directory, SuSE uses it to (temporarily) mount CD-ROMs. Every user on
the system can do this by simply invoking the command mount /cdrom.
|
2.1.4 | /dev: Device special files |
|
Device special files are located in /dev. We cover the most important
facts about this directory earlier in Chapter 1.
|
|
You can find a list of all possible device special files in Appendix A
.
|
|
In addition to the device special files, additional links can be found
in /dev, as shown in Table 2-2
. While these
always present, the links in Table 2-3
depend on the
system configuration. The link /dev/modem should not be
used for a modem that supports dial-in as well as dialout, as it tends
to cause lock file problems.
|
Table 2-2 |
Links in /dev |
|
Link name |
Points to |
Usage |
/dev/fd |
/proc/self/fd |
File descriptors |
/dev/stdin |
fd/0 |
stdin file descriptor |
/dev/stdout |
fd/1 |
stdout file descriptor |
/dev/stderr |
fd/2 |
stderr file descriptor |
/dev/nfsd |
socksys |
Required by iBCS-2 |
/dev/X0R |
null |
Required by iBCS-2 |
/dev/core |
/proc/kcore |
Backward compatibility |
/dev/ramdisk |
ram0 |
Backward compatibility |
/dev/ftape |
rft0 |
Backward compatibility |
/dev/scd? |
sr? |
Alternate SCSI CD-ROM name |
|
|
|
Table 2-3 |
System dependent links in /dev |
|
Link name |
Points to |
Usage |
/dev/mouse |
mouse port |
Current mouse device |
/dev/cdrom |
CD-ROM device |
Current CD-ROM device |
/dev/cdwriter |
CD-writer |
Current CD-writer device |
/dev/scanner |
scanner |
Current scanner device |
/dev/modem |
modem port |
Current dialout device |
|
|
Furthermore, there are some non-transient sockets in /dev, listed in Table 2-4
.
|
Table 2-4 |
Non-transient links in /dev |
|
Name |
Usage |
/dev/printer |
local socket for printing |
/dev/log |
local syslog socket |
/dev/gpmdata |
mouse multiplexer |
|
|
|
2.1.5 | /etc: Host Specific Configuration Files |
|
The directory /etc is where all major configuration files
are located. Applications that need more than one or two files have
their own subdirectories in /etc. The kind of files found
in /etc depends on the amount of software installed.
Tables 2-5
,
2-6
,
2-7
,
and 2-8
list some of most important files and
directories in /etc along with a short description of their meaning.
|
Table 2-5 |
Subdirectories within /etc |
|
Directory |
Content |
/etc/pcmcia |
PCMCIA configuration and startup files |
/etc/mail |
Sendmail configuration |
/etc/ppp |
PPP configurations |
/etc/isdn |
Isdn4linux configuration files |
/etc/httpd |
Apache web server configuration |
/etc/skel |
Template for user home directories |
/etc/default |
Default settings for new users |
/etc/profile.d |
Additional shell profiles |
/etc/SuSEconfig |
Files created by SuSEconfig |
/etc/rc.d |
link to /sbin/init.d |
/etc/cron.daily |
Scripts in here are executed once a day |
|
|
|
Table 2-6 |
Network related configuration files |
|
File |
Function |
HOSTNAME |
hostname of the local machine |
exports |
NFS server exports |
ftpaccess |
FTP server configuration |
ftpconversions |
|
ftpusers |
|
host.conf |
BIND configuration |
hosts |
List of remote hosts with IP addresses |
hosts.allow |
TCP wrapper lists of host permissions |
hosts.deny |
|
hosts.equiv |
|
hosts.lpd |
List of remote hosts allowed to print |
inetd.conf |
Internet ``super-server'' configuration |
services |
Service name to port translation table |
resolv.conf |
BIND configuration |
protocols |
Protocol descriptions |
|
|
|
Table 2-7 |
Shell profiles |
|
File |
Function |
csh.cshrc |
Csh and tcsh profiles |
csh.login |
|
profile |
Bash/sh profile |
zshrc |
Zsh profile |
shells |
List of valid login shells |
ssh_config |
Secure shell configuration and keys |
ssh_host_key |
|
ssh_host_key.pub |
|
ssh_random_seed |
|
sshd_config |
|
|
|
|
Table 2-8 |
Miscellaneous files in /etc |
|
File |
Function |
XF86Config |
XFree86 server configuration |
aliases |
Sendmail alias database |
aliases.db |
|
sendmail.cf |
Sendmail configuration |
printcap |
Printer configuration |
apsfilterrc |
|
autolog.conf |
Auto logout configuration |
conf.modules |
Kerneld module list |
crontab |
System crontab |
fdprm |
Floppy disk parameter table |
fstab |
List of file systems and mount points used by mount |
mtab |
List of mounted file systems |
inittab |
Init configuration, describes the run levels |
ld.so.conf |
Dynamic linker configuration |
lilo.confy |
Boot Loader configuration |
magic |
List of magic numbers |
motd |
Message of the day |
passwd |
User definitions |
shadow |
|
group |
Group definitions |
gshadow |
|
permissions |
File permissions |
rc.config |
SuSE's central configuration file |
rc.config.d |
additions to /etc/rc.config |
syslog.conf |
Syslog daemon configuration |
termcap |
Terminal definitions |
ttytype |
Assign terminal types to terminals |
|
|
The FHS foresees the development of a directory called
/etc/X11, which is not present in SuSE Linux
Systems. SuSE will incorporate this directory in future releases to
become more compliant to the FHS. The only X11-related file is
/etc/XF86Config. The other files that should be in
/etc/X11 can be found in /usr/X11R6/lib/X11.
|
2.1.6 | /home: User home directories |
|
The home directory of each individual user is located in
/home. Depending on your system setup,you may want to
sort users into several subdirectories within this hierarchy. For
example, you could have /home/sales and
/home/development as directories that put the homes of
users relating to different departments in there.
SuSE creates home directories and places them in /home
unless you instruct it to do otherwise.
|
2.1.7 | /lib: Essential shared libraries and kernel modules |
|
The /lib directory contains the shared
libraries needed to run the binaries in the root file system.It also
contains the directories /lib/modules and /lib/YaST.
The /lib/modules directory contains the dynamic loadable
modules for the Linux kernel. They are sorted by kernel version and
functionality, as shown in Table 2-9
for kernel version 2.2.1.
|
Table 2-9 |
Module subdirectories |
|
Directory |
Contents |
/lib/modules/2.2.1 |
Modules for kernel version 2.0.36 |
/lib/modules/2.2.1/block |
block device drivers |
/lib/modules/2.2.1/cdrom |
CD-ROM drivers |
/lib/modules/2.2.1/fs |
File system drivers |
/lib/modules/2.2.1/ipv4 |
IP stack modules |
/lib/modules/2.2.1/misc |
Miscellaneous modules |
/lib/modules/2.2.1/net |
Network drivers |
/lib/modules/2.2.1/pcmcia |
PCMCIA modules |
/lib/modules/2.2.1/scsi |
SCSI drivers |
|
|
|
2.1.8 | /mnt: Mount point of temporary partitions |
|
The /mnt directory is provided for temporarily mounted file
systems. It is not recommended that you use this directory for anything
that is important to the system.
|
2.1.9 | /opt: Add-on application software packages |
|
The /opt directory is reserved for installing add-on application
software packages, such as Netscape, Applixware, KDE, and so on.
The directories /opt/bin, /opt/doc,
/opt/include, /opt/info,
/opt/lib, and /opt/man are reserved for
local system administrator use. They are not created by default on
SuSE systems. The directories /etc/opt and
/var/opt are also not present in SuSE systems; however,
they are recommended by the FHS for local configuration data and
variable data needed by packages installed in the /opt hierarchy.
No other package files should exist outside the /opt,
/var/opt, and /etc/opt hierarchies except
for those package files that must reside in specific locations within
the file system tree in order to function properly. For example,
device lock files must be placed in /var/lock and devices
must be located in /dev.
|
2.1.10 | /root: Home directory for the root user |
|
The traditional home directory for the root account is /. Many Linux
systems still use the root directory for this purpose. However, there
are good reasons to assign root its own directory.
Primarily, you want to keep as few files as possible in
/, in order to keep it clean. Placing root's home into
/home is not a good idea, because this directory may not exist on
the root file system but may be mounted from another partition or even
from another machine by using NFS. In case of a system crash or other
emergency, root's home has to be on the root file system in order for
the system administration to log on as root.
The FHS recommends that you use /root, so SuSE
incorporated this issue and installed this directory to the superusers
home directory.
|
2.1.11 | /sbin: Essential system binaries |
|
The directory /sbin contains binaries essential for
booting the system in addition to the binaries in /bin.
Users have read and execute permission for everything in
/sbin except some setuid and setgid programs. The
division between /bin and /sbin was not
created for security reasons or to prevent users from seeing the
operating system, but rather to provide a good partition between
binaries that everyone uses and binaries that are used primarily for
administration tasks. SuSE puts the commands shown in the following
list into its /sbin directory.
|
| SuSEconfig dumpe2fs insmod modprobe setserialbits
YaST e2fsck ipfwadm pack_cis sfdisk
activate e2label kbdrate pcinitrd shutdown
agetty fdisk kerneld pidof sln
badblocks fsck killall5 powerd start-stop-daemon
bg_backup fsck.ext2 killproc poweroff startproc
bg_restore fsck.minix ksyms rarp sulogin
bootp ftl_check ldconfig rcmysql swapoff
bootpc ftl_format lilo rctab swapon
cardctl genksyms losetup rdump taper
cardmgr halt lsmod reboot telinit
cfdisk hdparm mingetty restore tune2fs
checkproc hwclock mkdosfs rmmod udosctl
conf.d ide_info mke2fs rmt umssetup
ctrlaltdel ifconfig mkfs route umssync
debugfs ifport mkfs.ext2 rrestore update
depmod ifuser mkfs.minix runlevel yast
dump init mkfs.msdos scsi_info zast
dump_cis init.d mkswap setserial
|
|
There are two important subdirectories in /sbin --
/sbin/init.d and /sbin/conf.d. The directory
init.d contains the boot up scripts -- which we'll
discuss more in Chapter 6
-- and
conf.d
contains scripts used by SuSEconfig, which we discuss in Part VI.
|
2.1.12 | /tmp: Temporary files |
|
The /tmp directory is available for programs that require
temporary files. Its permissions allow every user to write into this
file system, yet no one can remove other users' files unless the owner
grants permission.
Users should not assume that any files or directories in
/tmp are preserved between invocations of the program.
The FHS added the recommendation that /tmp be cleaned at
boot time on the basis of historical precedent and common practice,
but it does not make it a requirement. SuSE does not implement any
regular cleanup of /tmp in its system setup. The
administrator has the option to add a corresponding command to the
bootup scripts.
|
2.2 | /usr: Secondary hierarchy |
|
/usr is the second major section of the file system. The
/usr hierarchy consists of shareable, read-only data, as
you saw in Table 1-1. The /usr hierarchy
should therefore be shareable between various hosts and should not be
written to. Any information that is host specific or varies with time
is stored elsewhere.
No large software packages should use a direct subdirectory under the
/usr hierarchy. The only exception made by the FHS is for
the X Window System because of considerable precedent and widely
accepted practice. In contrast, SuSE installs some other third-party
software in /usr. These are mostly commercial software
packages that haven't adopted the FHS yet and are in /usr
rather than /opt. Figure 2-2
shows the first
level of the /usr hierarchy.
|
Figure 2-2 |
|
| The /usr file system |
|
Some symbolic links to directories are present to preserve
compatibility with older systems:
|
| /usr/spool --> /var/spool
/usr/tmp --> /var/tmp
/usr/X11 --> /usr/X11R6
/usr/dict --> /usr/share/dict
|
|
|
2.2.1 | /usr/X11R6: X Window System, version 11, release 6 |
|
In the /usr/X11R6 hierarchy, you'll find the X Window
System, version 11, release 6, and related files.
To simplify matters and make XFree86(TM) more compatible with the X
Window System on other systems, the following symbolic links are
present:
|
| /usr/bin/X11 --> /usr/X11R6/bin
/usr/lib/X11 --> /usr/X11R6/lib/X11
/usr/include/X11 --> /usr/X11R6/include/X11
|
|
Host-specific data is in /usr/X11R6/lib/X11. The FHS
intends this directory to be used for demonstration files only. Because
SuSE doesn't use /etc/X11, the configuration files for
window managers, applications, and so on are still in this directory.
|
2.2.2 | /usr/bin: Most user commands |
|
The /usr/bin directory is the primary directory of executable commands
on the system. All binaries that don't belong to /bin, /sbin, or
/usr/sbin can be found here.
|
2.2.3 | /usr/include: Directory for standard include files |
|
The /usr/include directory holds all the system's
general-use include files for the C and C++ programming languages. It
contains several subdirectories for different compilers, languages,
and libraries. See Figure 2-2. The subdirectory's presence strongly
depends on the amount and kind of software you installed.
|
2.2.4 | /usr/lib: Libraries for programming and packages |
|
The /usr/lib directory contains object files, libraries, and internal
binaries that are not intended to be executed directly by users or
shell scripts.
All architecture-dependent data exclusively used by the application
can be found in a single subdirectory of /usr/lib. For
example, the perl5 subdirectory contains Perl5 modules and
libraries. More examples can be seen in Figure 2-2. The
figure should be interpreted as an example of what can be found in
/usr/lib, because the subdirectories you find here depend
on the software installed on the system. Traditionally, executable
commands such as sendmail were placed in /usr/lib. The
sendmail binaries are now placed by default in /usr/sbin, and a
symbolic link remains to /usr/lib.
|
2.2.5 | /usr/local: Local hierarchy |
|
The /usr/local hierarchy is for use by the system
administrator when installing software locally. It should be protected
from overwriting when the system software is updated. It may be used
for programs and data that are shareable among a group of hosts, but
are not found in /usr.
The FHS requires that this directory always be empty after you first
install the system. With SuSE Linux, two subdirectories are installed
to /usr/local for system use. These are
/usr/local/ftp and /usr/local/http, the
document trees for the FTP and the HTTP (Web) server,
respectively. Once again, the reasons for this are largely
historical. The FHS does not provide recommendations as to where to
place data such as this.
Other than the preceding requirements, the /usr/local
hierarchy is free for use by the local system administrator to install
software that doesn't come from the installation CDs. Beware
that installing software into other parts of the file system may be
affected by updates or patches of the distribution.
|
2.2.6 | /usr/sbin: Non-essential standard system binaries |
|
The /usr/sbin directory contains any nonessential
binaries used exclusively by the system administrator. System
administration programs that are required for system repair, system
recovery, mounting /usr, or other essential functions are
placed in /sbin. This directory also contains networking
daemons, any nonessential administration tools, and binaries for
noncritical server programs.
Locally installed system administration programs should be placed in
/usr/local/sbin.
|
2.2.7 | /usr/share: Architecture-independent data |
|
The /usr/share hierarchy is for all read-only architecture
independent data files. The hierarchy is shareable among all
architecture platforms of a given OS. For example, as soon as the
Suse distribution is available for these processors, a site with i386,
Alpha, and ARM platforms might maintain a single
/usr/share directory that is centrally mounted. Figure
2-2 shows a typical /usr/share tree of a SuSE
system.
|
2.2.8 | /usr/share/man: Manual pages |
|
The /usr/share/man subtree contains the manual
pages. They are stored in a separate subdirectory for each section.
|
|
|
man1: User programs
The man1 subdirectory contains manual pages that describe publicly
accessible commands. Most program documentation that a user will need
is located here.
|
|
man2: System calls
The man2 subdirectory describes all the system
calls (requests for the kernel to perform operations).
|
|
man3: Library functions and subroutines
Section 3 describes
program library routines that are not direct calls to kernel
services. This and Chapter 2 are really of interest to programmers
only.
|
|
man4: Special files
Section 4 describes the special files, related
driver functions, and networking support available in the
system. Typically, this section includes the device files found in
/dev and the kernel interface to networking protocol
support.
|
|
man5: File formats
The formats for many nonintuitive data files
are documented in section 5. Included are various include files,
program output files, and system files.
|
|
man6: Games
Section 6 documents games, demos, and generally
trivial programs. Differing opinions exist about how essential this
section is.
|
|
man7: Miscellaneous
Manual pages that are difficult to classify
are designated as section 7 pages. The troff and other text-processing
macro packages are found here.
|
|
man8: System administration
Documentation for programs used by
system administrators for system operation and maintenance are found in
section 8. Some of these programs are occasionally useful for less
technical users.
|
|
|
Note that only the sources (usually to be processed by groff) are
stored in this hierarchy. After a man page has been requested, a
formatted version will be stored in /var/catman.
|
2.2.9 | /usr/src: Source code |
|
The /usr/src hierarchy contains the system source code. It typically
contains the kernel source code in /usr/src/linux and the source of
software packages in /usr/src/packages. Figure 2-3
shows
this hierarchy.
|
Figure 2-3 |
|
| The /usr/src file system |
|
/usr/src/linux is usually a link to the kernel source
tree of a specific version. This is useful because you may have
installed sources of different kernel versions. Some software packages
(for example, the PCMCIA utilities) need to access the kernel source
in order to be compiled. By setting the link to the kernel version
you'd like to build them for, you can easily switch between different
versions. We discuss the /usr/src/packages hierarchy in
more detail in Part 6.
|
2.3 | /var: Variable data |
|
The /var hierarchy contains variable data files. This
includes spool directories and files, administrative and logging data,
and transient and temporary files. Figure 2-4
shows the
subdirectories in /var.
|
Figure 2-4 |
|
| The /var file system |
|
Some portions of /var are not shareable between different
systems such as /var/log, /var/lock, and
/var/run. Other portions may be shared, notably
/var/spool/mail, /var/cache/fonts, and
/var/spool/news.
The /var hierarchy is used in order to make it possible
to mount /usr read-only. Everything that once went into
/usr that is written to during system operation (as opposed to
installation and software maintenance) is now in /var.
If /var cannot be made a separate partition, it is often
preferable to move the contents of /var out of the root partition and
into the /usr partition. This is sometimes done to reduce
the size of the root partition or when space runs low in the root
partition. The /var hierarchy should not be linked to
/usr because this makes separation of /usr
and /var more difficult and is likely to create a naming
conflict. Instead, link /var to /usr/var.
The /var hierarchy contains the greatest differences
between the SuSE file system and the FHS. The FHS no longer supports
/var/lib and refers to it as /var/state
instead. SuSE has not yet implemented /var/state. In
addition, the mail spool directory, which the FHS places in
/var/mail, is located in /var/spool/mail on
SuSE systems.
The spool directory for outgoing mail, which the FHS sees as
/var/spool/mqueue, is /var/mqueue, and some
cache directories are not in /var/cache, where FHS
expects to find them, but in other parts of the /var
hierarchy. The overall idea of /var is to separate static
and variable data in two different trees, /usr and
/var, which is done in the SuSE
distribution. Incompatibilities with the FHS are caused by SuSE's
requirement that subsequent releases remain compatible with older
revisions. This will likely change with future releases.
|
2.3.1 | /var/cache: Application cache data |
|
The /var/cache hierarchy is reserved for cached data from
applications. Such data is locally generated as a result of
time-consuming I/O or calculation. The application must be able to
regenerate or restore the data. Unlike /var/spool, the
cached files can be deleted without data loss. The data should remain
valid between invocations of the application and rebooting the
system.
Files located under /var/cache may be expired in an
application-specific manner, by the system administrator, or both. The
application should always be able to recover from manual deletion
of files (generally because of a disk space shortage). No other
requirements are made on the data format of the cache directories.
|
2.3.2 | /var/lock: Lock files |
|
Lock files are stored within the /var/lock directory
structure. These are (for example) device lock files, such as the
serial device lock files. The naming convention used is
LCK.., followed by the base name of the device. For
example, to lock /dev/cua0, you would create the file
/var/lock/LCK..cua0. The format used for device lock
files is the HDB UUCP lock file format. The HDB format is to store the
process identifier (PID) as a 10-byte ASCII decimal number, with a
trailing newline. For example, if process 1230 holds a lock file, it
contains the eleven characters: space, space,space, space, space,
space, one, two, three, zero, and newline.
Then, anyone who wishes to use /dev/cua0 can read the
lock file and act accordingly (all locks in /var/lock are
world-readable). Some applications, such as Netscape, store private
locks within their own data space.
|
2.3.3 | /var/log: Log files and directories |
|
The /var/log directory contains miscellaneous log
files. Most logs are written to this directory oran appropriate
subdirectory. Table 2-10
lists the most important log files
contained in /var/log.
|
Table 2-10 |
Log files in /var/log |
|
File |
Content |
boot.msg |
messages from the last system boot |
httpd.access_log |
Web server access log |
httpd.error_log |
Web server error log |
lastlog |
record of last login of each user |
mail |
mail sever log file |
messages |
system messages from syslogd |
news |
news server log file |
warn |
important/critical system messages |
wtmp |
record of all logins and logouts |
xdm.errors |
xdm error messages |
|
|
|
2.3.4 | /var/spool/mail: User mailbox files |
|
The /spool/mail directory contains user mailbox files
stored in the standard Unix mailbox format. Each user has a mailbox
file in this directory. These files can be accessed by the users MUA
(that is for example mutt, pine, or
mailx), or by local daemons (like pop or
imap) to deliver the mail to the user agent.
Following the terms of the FHS, these files should be in
/var/mail. Because SuSE did not want to create
incompatibilities with previous installations, it retained
/var/spool/mail for mailboxes.
|
2.3.5 | /var/run: Run-time variable files |
|
The /var/run directory contains system information files
describing the system since it was booted. Files in this directory are
cleared (removed or truncated as appropriate) at the beginning of the
boot process.
Process identifier (PID) files are placed in /var/run. The
naming convention for PID files is
program-name.pid. For example, the
crond PID file is named /var/run/crond.pid.
The file consists of the process identifier in ASCII-encoded decimal,
followed by a newline character. For example, if crond
was process number 25, /var/run/crond.pid will contain
three characters: two, five, and newline.
The utmp file, which stores information about who is
currently using the system, is also located in this directory.
|
2.3.6 | /var/spool: Application spool data |
|
The /var/spool directory contains data that is awaiting
processing at a later date. Data in /var/spool represents
work to be done in the future (by a program, user, or administrator);
often, data is deleted after it has been processed. Table 2-11
lists
some important subdirectories in /var/spool.
|
Table 2-11 |
Spool directories in /var/spool |
|
File |
Function |
atjobs |
at daemon files |
atspool |
|
fax |
outgoing faxes |
locks |
compatibility link to /var/lock |
lpd |
Printer spool directory |
mail |
User mailboxes |
news |
Spooled news messages |
rwho |
Rwhod files |
uucp |
Spool directory for UUCP |
uucppublic |
|
|
|
|
2.3.7 | /var/tmp: Temporary files preserved between system reboots |
|
The /var/tmp directory is made available for programs
that require temporary files or directories that are preserved between
system reboots. Therefore, data stored in /var/tmp is
more persistent than data in /tmp.
Files and directories located in /var/tmp are not deleted
when the system is booted. The files in /tmp are also not
deleted in SuSE systems. It is possible that they will be deleted in
future releases.
|
|
Summary: |
|
The FHS (File System Hierarchy Standard) defines the layout
of the file system for Linux installations. It specifies three major
directory trees: the directory tree /usr, which contains
static files; the directory tree /var, which contains
variable data; and the directory tree /etc, which
holds configuration files.
The root file system (/) must hold all programs and
utilities needed to boot the system and to mount additional file
systems.
In most instances, SuSE is compliant with the FHS. It differs only
slightly from the standard of the FHS. It aims to preserve the
principles of the FHS even in the few exceptions where it violates
it.
|
|