Книга: Fedora™ Unleashed, 2008 edition
Use and Edit Files in the /etc Directory
Use and Edit Files in the /etc
Directory
More than 90MB of system configuration files and directories reside under the /etc
directory if you install all the software included with this book. Some major software packages, such as Apache, OpenSSH, and xinetd,
have directories of configuration files under /etc.
Other important system-related configuration files in /etc
include the following:
? fstab
— The file system table is a text file listing each hard drive, CD-ROM, floppy, or other storage device attached to your PC. The table indexes each device's partition information with a place in your Linux file system (directory layout) and lists other options for each device when used with Linux (see Chapter 35, "Managing the File System"). Nearly all entries in fstab can be manipulated by root using the mount
command.)
? inittab
— The system initialization table defines the default runlevel, also known as run-control level or system state. Changes to this file can determine whether your system boots to a graphical or text login, as well as whether dialup remote access is enabled. (You learn about default runlevels in the section "System Services and Runlevels" located in Chapter 11. See the section "Starting X" located in Chapter 3, "Working with GNOME," to learn more about changing inittab to boot to a graphical interface.)
? modprobe.conf
— This configuration file contains directions and options used when loading kernel modules to enable various types of hardware, such as sound, USB, networking, and so on (discussed in the section "Managing Modules" in Chapter 36, "Kernel and Module Management"). The contents of this file are used during boot
time, and the file can be manually edited or automatically updated by Fedora's kudzu
hardware management tool.
? passwd
— The list of users for the system, along with user account information. The contents of this file can be changed by various programs, such as useradd
or chsh.
? printcap
— The system's printer capabilities database (discussed in the section "Overview of Fedora Printing" in Chapter 8, "Printing with Fedora").
? shells
— A list of approved shells (command-line interfaces).
The /etc/sysconfig
directory contains many different hardware and software settings critical to the operation of your Fedora system. Knowing the location and contents of these files can prove helpful if you need to troubleshoot new hardware configurations. The best way to list the contents of /etc/sysconfig
is to use the tree
command, like so:
$ tree -afx /etc/sysconfig
The settings in various files under /etc/sysconfig
(such as firstboot, keyboard, clock,
and so on) are usually created automatically by a related Fedora graphical or console- based configuration utility.
These contents might change dynamically if you use the kudzu
hardware configuration service. The kudzu
service also prompts you at boot time to remove, configure, or ignore a related setting if kudzu
detects new or different hardware (such as a new USB keyboard, network card, or monitor). The kudzu
service creates a file called hwconf
that contains a hardware profile of your PC's current state. Note that if kudzu
is not enabled or running, you can use device-specific configuration utilities such as system-config-keyboard
, or you can manually edit configuration files.
Information about the type of keyboard attached to the PC, for example, is contained in the file /etc/sysconfig/keyboard
:
KEYBOARDTYPE="pc"
KEYTABLE="uk"
Here the keyboard in use is the U.K. layout, but if you are in the United States, you will likely see this:
KEYBOARDTYPE="pc"
KEYTABLE="us"
CAUTION
If you are new to Linux, the system-config-keyboard
client is the best tool to use to configure a keyboard. You should manually edit system hardware configuration files used by graphical management clients only as a last resort.
- Navigating Through the File System
- Managing Files with the Shell
- Working with Compressed Files
- Use Essential Commands from the /bin and /sbin Directories
- Use and Edit Files in the /etc Directory
- Protect the Contents of User Directories — /home
- Use the Contents of the /proc Directory to Interact with the Kernel
- Work with Shared Data in the /usr Directory
- Temporary File Storage in the /tmp Directory
- Access Variable Data Files in the /var Directory
- Creating CDs from the Command Line
- Use and Edit Files in the
- Use Essential Commands from the
- Temporary File Storage in the
- Working with Graphics Formats
- Creating DVDs from the Command Line
- User Management Tools
- Assigning Permissions
- Understanding Set User ID and Set Group ID Permissions
- Implementing Quotas
- System Services and Runlevels
- Using cron to Run Jobs Repeatedly