Software Configuration

When the OpenBSD kernel finishes its initial system setup and hands control of the system over to userland, init(8) runs the shell script /etc/rc. This script starts all of the programs integrated with the system and performs general system configuration, such as configuring network interfaces and starting server software. To enable, disable, or otherwise configure integrated software, modify the files /etc/rc.conf and /etc/rc.conf.local. (I’ll cover the OpenBSD boot process in detail in Chapter 5, but for now, this section will get you started.)

The files rc.conf and rc.conf.local contain shell script variable assignments that control what /etc/rc runs and the command-line options for the various programs. Keep in mind that any entries in rc.conf.local override rc.conf statements. Most variable assignments have three legitimate values: an uppercase NO, command-line flags in quotation marks ("-D"), or double quotes (""), which are equivalent to empty. Each variable looks something like this entry from rc.conf:

ntpd_flags=NO           # for normal use: ""

The variable ntpd_flags controls the command-line flags that /etc/rc uses when starting ntpd(8).

A NO disables this particular piece of functionality. In the preceding example, the NTP daemon ntpd(8) is disabled.

If the variable is empty, /etc/rc starts the program without any command-line arguments. For example, this ntpd_flags entry means that ntpd is to be started without any arguments.

ntpd_flags=""

Anything within quotes is used as a command-line argument to the program. (If a program has typical default flags, they’ll usually appear in rc.conf.) The following example assigns the variable ntpd_flags the value -s. When the system boots, rather than running ntpd, it will run ntpd -s:

ntpd_flags="-s"

Some variables have additional possible values. For example, the PF packet filter (see Chapter 21) is enabled with a YES. To enable the NFS automounter daemon, you’ll need to use a path to the master map. (If you don’t know what the automounter is, that’s fine—not many do these days.) Just realize that weird values for rc.conf variables do exist. You’ll see these values listed in rc.conf.

Note

OpenBSD defaults appear in /etc/rc.conf, but do not edit this file! This is a core system file, and will be replaced during an upgrade. Put your local changes in /etc/rc.conf.local. Entries in rc.conf.local will override the defaults in rc.conf.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.82.253