rc - command scripts for system startup
rc is the command script that is invoked by init(8) during
reboot and after single user mode is exited; it performs
chores and starts up system daemons. Additionally,
rc is intricately
tied to the netstart(8) script, which runs commands
pertaining to the network. The rc.securelevel and rc.local
commands which are pertinent only to a specific site.
All four of these startup scripts are (or can be) controlled
to some extent
by variables defined in rc.conf(8) and rc.conf.local(8), which specify
which daemons and services to run.
When an automatic reboot is in progress, rc is invoked with
autoboot. The first portion of rc runs an fsck(8) with option -p to
``preen'' all disks of minor inconsistencies resulting from
the last system
shutdown and to check for serious inconsistencies caused
or software failure. If this auto-check and repair succeeds, then the
second part of rc is run.
However, if the file /fastboot exists, fsck(8) will not be
this boot. This file is then removed so that it will be run
The second part of rc, which is run after an auto-reboot
succeeds and also
if rc is invoked when a single user shell terminates (see
then asks rc.conf(8) for configuration variables, mounts
starts system daemons, preserves editor files, clears the
/tmp, and saves any possible core image that might have
as a result of a system crash, with savecore(8).
Before rc starts most system daemons, netstart(8) is executed.
rc.securelevel is executed by rc to start daemons that must
be run before
the security level changes. Following this, rc then sets
level to the value specified in the securelevel variable in
See securelevel(7) for the effects of setting the security
rc.local is executed towards the end of rc (it is not the
very last as
there are a few services that must be started at the very
rc.local contains commands and daemons that are not part
of the stock
CONFIGURATION EXAMPLES [Toc] [Back]
The rc.conf(8) file contains a series of Bourne-shell syntax
that are used to configure kernel configurations, network
and various other system daemons. As described above, this
sourced (using sh(1) of course) by /etc/rc. Various comments in
rc.conf(8) make it clear what each variable does. Refer to
man pages for each daemon to determine what that subsystem
For example, the lpd(8) daemon is controlled by the following line:
lpd_flags=NO # for normal use: "" (or "-l" for
This does not start lpd(8) at system startup. To start
lpd(8), the following
entry can be used:
lpd_flags="" # for normal use: "" (or "-l" for
Alternately, lpd(8) can be started with the -l flag (to log
lpd_flags="-l" # for normal use: "" (or "-l" for
Before init(8) starts rc, it sets the process priority,
umask, and resource
limits according to the ``daemon'' login class as described in
/etc/rc Command scripts for system startup.
/etc/rc.local Site specific command scripts for
/etc/rc.conf System daemon configuration database.
/etc/rc.conf.local Site specific daemon configuration
/etc/rc.securelevel Commands run before the security level changes.
/etc/rc.shutdown Commands run at system shutdown.
/etc/login.conf Login class capability database.
/etc/netstart Command script for network startup.
login.conf(5), sysctl.conf(5), securelevel(7), init(8), netstart(8),
rc.conf(8), rc.shutdown(8), reboot(8), savecore(8)
The rc command appeared in 4.0BSD.
OpenBSD 3.6 December 11, 1993
[ Back ]