Common Configuration Files

The traditional location for system configuration files in Unix-like systems is /etc, and Linux is no exception to this rule. Indeed, many obscure packages, including some that don't even ship with most distributions, install their configuration files in /etc. As a result, this directory's contents vary from one system to another, and I cannot describe every file or subdirectory it contains. Table 9.1 summarizes some of the most important files and subdirectories found in /etc on most distributions, though. Subdirectories are indicated by a trailing slash (/) in the name.

Table 9.1: Common Files and Subdirectories of/etc

File or Subdirectory Name

Function

bashrc, bash.bashrc, orbash.bashrc.local

System-wide default bash configuration file.

cron.d/, cron.daily/, cron. hourly/, cron.monthly/, cron.weekly/, crontab

Configuration files for system cron jobs; crontab controls cron, and the subdirectories hold scripts that execute on a regular basis.

csh.cshrc, csh.cshrc.local, csh.login, and csh.logout

System-wide default csh configuration files.

cups/

CUPS configuration files.

exports

Control file for Network File System (NFS) server.

fstab

Filesystem table file; describes filesystems, their mount points, and their options.

group

Specifies Linux groups and their options.

hostname or HOSTNAME

Holds the local computer's hostname.

hosts

Maps hostnames to IP addresses. Frequently used for local hostname/IP address mapping in lieu of a local DNS server.

hosts.allow and hosts.deny

Part of TCP Wrappers; specify what systems may or may not contact servers that use TCP Wrappers for security.

hosts.equiv

Lists computers that may access any of several servers, such as rlogin and BSD LPD print servers. Using this file is potentially dangerous; it should be empty, and more server-specific files used instead.

hosts.Ipd

Lists computers that may access BSD LPD print servers.

File or Subdirectory Name

Function

httpd/ or apache/

Directory holding web server (Apache) configuration files.

inetd.conf

Configuration file for the inetd super server.

init.d/

Subdirectory holding SysV startup scripts. This is a subdirectory of/etc/rc.d on some systems.

inittab

Initial startup file; the kernel uses this file to control the very early stages of the boot process. After booting, this file controls the critical init process.

lilo.conf

The configuration file for the Linux Loader (LILO) boot loader program used by many Linux installations on IA-32 hardware.

logrotate.conf and logrotate.d/

Specify how the logrotate program, which is run daily via cron, is to handle log file rotation.

modules.conf

Defines the kernel modules that the system should attempt to load when programs try to access particular devices.

mtab

Holds information on mounted filesystems.

File or Subdirectory Name

Function

named.conf

Primary configuration file for the Berkeley Internet Name Domain (BIND) Domain Name System (DNS) server.

pam.d/

Directory holding configuration files for the Pluggable Authentication Modules (PAM) tool, which mediates most user login requests.

File or Subdirectory Name

Function

passwd

Primary user account definition file. (The shadow file usually holds actual passwords and additional data, though.)

ppp/

Directory in which Point-to-Point Protocol (PPP) dial-up networking account information and scripts are stored.

printcap

File specifying printer capabilities, used primarily by the BSD LPD and LPRng printing systems.

profile and profile.d/

Default bash login script and subdirectory with additional component scripts that may be called.

rc?.d/

Subdirectories holding SysV startup scripts for specific runlevels (? is the runlevel number). May be subdirectories of rc.d orinit.d.

rc.d/

Subdirectory holding SysV startup scripts, possibly in their own subdirectories. Sometimes this is a symbolic link to /etc/init.d.

samba/or samba.d/

Subdirectory holding configuration files for the Samba file and print server package.

services

File holding mappings of names to port numbers for common servers.

shadow

Shadow password file; holds encrypted user passwords and advanced account information in a file that's readable only to root.

ssh/

Holds configuration files for the Secure Shell (SSH) login server.

File or Subdirectory Name

Function

sysconfig/

Contains miscellaneous system configuration files, such as files holding network configuration options. SysV startup scripts typically reference these files.

X11/

Holds configuration files for the X Window System (X) and some related subsystems, such as X-based login tools.

XF86Config orXF86Config-4

Main XFree86 configuration file. This file often appears in /etc/X11.

xinetd.conf and xinetd.d/

Configuration file and subdirectory for the xinetd super server.

Table 9.1 is long, but even so, it doesn't present all of the configuration files and subdirectories in a typical Linux system. On the flip side, some of these files and directories aren't present on some Linux systems; for instance, if you haven't installed SSH, your system most likely won't have an /etc/ssh directory.

Table 9.1 is long, but even so, it doesn't present all of the configuration files and subdirectories in a typical Linux system. On the flip side, some of these files and directories aren't present on some Linux systems; for instance, if you haven't installed SSH, your system most likely won't have an /etc/ssh directory.

The /etc/inittab file is particularly critical for the system startup procedure. It defines certain processes that run constantly, such as getty or a similar program, which attaches itself to a text-mode console and runs the login program to accept text-mode logins. Just as important, inittab kicks off the rest of the startup process, through a line beginning with si. In a Red Hat system, this line is as follows:

si::sysinit:/etc/rc.d/rc.sysinit

Effectively, this line passes control of the startup process to /etc/rc.d/rc.sysinit—but the name of this script varies from one distribution to another, as detailed in the next few sections. Another detail set in /etc/inittab is the default runlevel—a number that serves as a code for a particular set of default servers and other programs to run. The runlevel is set in a line that begins with id, as in:

id:5:initdefault:

This line sets the runlevel to 5. Runlevels 0, 1, and 6 have special meanings and should never be specified in /etc/inittab. Most Linux distributions use runlevel 3 to mean a text-mode startup and runlevel 5 to mean a GUI startup. Slackware uses 4 instead of 5 for GUI startups, though, and Debian uses other means to determine when to perform a GUI startup.

Most Linux distributions use a startup script system borrowed from System V Unix, and hence referred to as SysV startup scripts. These scripts are stored in /etc/init.d, /etc/rc.d, or a subdirectory of one of these directories. Typically, subdirectories called rc?.d, where ? is the runlevel, hold symbolic links to the startup scripts for specific runlevels. Within each runlevel's directory, scripts whose names start with S are used to start a service, and those whose names start with K shut down (kill) a service when the system enters that runlevel. The upcoming section, "Creating New SysV Startup Scripts," describes the SysV startup script naming convention in greater detail. Some distributions use major or minor variants on this system, as detailed in the next five sections. Slackware is the most unusual of these variants.

0 0

Post a comment