Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [29]

By Root 2592 0
comments:

• The hwconf file contains all of your hardware information. The obnoxious Kudzu service checks it to see if you have added or removed any hardware

and asks you what to do about changes. You will probably want to disable this service on a production system because it delays the boot process whenever it detects a change to the hardware configuration, resulting in an extra 30 seconds of downtime for every hardware change made.

• The network-scripts directory contains additional material related to network configuration. The only things you should ever need to change are the files named ifcfg-interface. For example, network-scripts/ifcfg-eth0 contains the configuration parameters for the interface eth0. It sets the interface’s IP address and networking options. See page 300 for more information about configuring network interfaces.

• The sendmail file contains two variables: DAEMON and QUEUE. If the DAEMON variable is set to yes, the system will start sendmail when the system boots. QUEUE tells how long after an error sendmail should queue mail before trying to redeliver it.

FreeBSD startup scripts


This section is specifically about FreeBSD, but the general outline of the startup process applies to most other BSD systems.

FreeBSD’s init runs only a single startup script, /etc/rc. This master script then runs the system’s other rc scripts, all of which live in /etc and are called rc.something. Scripts are run in a predefined order, with no concept of run levels.

/etc/rc starts off by reading (executing, really) three files that specify configuration information:

• /etc/defaults/rc.conf

• /etc/rc.conf

• /etc/rc.conf.local

The rc.conf files can also specify other directories in which to look for startup files. You specify the other directories by setting the value of the local_startup variable.

These config files work their magic by defining the values of shell variables. The rc scripts later check these variables to determine how to behave. /etc/rc uses the shell’s source command (or more accurately, its not-very-intuitive alias, “.”) to interpolate the config files and subsidiary scripts into its own execution stream; in effect, this procedure concatenates all the config files and startup scripts into one big script.

/etc/defaults/rc.conf is a huge file that lists all the configuration parameters and their default settings. This file should never be edited; the startup script bogeyman will hunt you down. To change the contents of a variable, just override its default value by setting it again in /etc/rc.conf or /etc/rc.conf.local. The rc.conf man page has an extensive list of the variables you can specify.

As you can see from looking at /etc, there are quite a few different rc scripts.

ls /etc/rc*

rc rc.diskless1 rc.isdn rc.pccard

rc.atm rc.diskless2 rc.local rc.resume

rc.conf rc.firewall rc.serial rc.devfs

rc.i386 rc.network rc.shutdown rc.suspend

/etc/rc starts by calling rc.diskless1 if the kernel is configured to be a diskless client. It next calls rc.sysctl, rc.serial, rc.pccard, and rc.network, then goes on to perform some housekeeping functions. As one of its final acts, it runs the rc.local script. If a script does not exist, rc just skips it. (In the listing above, rc.sysctl doesn’t exist.)

The default rc.serial script does nothing, but it defines a set of functions that can be used to initialize serial ports and devices at boot time.

If PCMCIA/CardBus support was specified in one of the rc.conf files, rc.pccard loads kernel modules relating to the PCMCIA controller and starts pccardd, the daemon that controls the configuration and deconfiguration of PCMCIA cards as they are inserted and removed.

rc.network is a long and involved script that sets up the machine’s networking environment. It uses variables specified in rc.conf to configure interfaces and deal with DHCP, PPP, routing, and firewalls. You don’t normally need to touch the script since all configuration is done in rc.conf. The rc.network script calls several other network-related rc scripts: rc.atm,

Return Main Page Previous Page Next Page

®Online Book Reader