|RC(8)||System Manager's Manual||RC(8)|
rc — command
scripts for system startup
rc is the command script that is invoked
by init(8) when the system
starts up. It performs system housekeeping chores and starts up system
rc is intricately tied to the
netstart(8) script, which
runs commands and daemons pertaining to the network.
rc is also used to execute any
rc.d(8) scripts defined in
scripts hold commands which are pertinent only to a specific site.
All of these startup scripts are controlled to some extent by variables defined in rc.conf(8), which specify which daemons and services to run.
Before init(8) starts
rc, it sets the process priority, umask, and
resource limits according to the “daemon” login class as
login.conf(5). It then
rc and attempts to execute the sequence of
The first part 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 by hardware 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 will not be invoked. The file
is then removed so that fsck will be run on subsequent boots.
The second part of
rc then asks
rc.conf(8) for configuration
variables, mounts filesystems, saves
dmesg(8) output to the file
/var/run/dmesg.boot, starts system daemons,
preserves editor files, clears the scratch directory
/tmp, and saves any possible core image that might
have been generated as a result of a system crash, with
If at any point the boot script fails,
init(8) enters single-user
mode, allowing the superuser a shell on the console. On exiting this mode,
init again invokes
rc, but this time without
performing the file system preen.
rc starts most system daemons,
rc.securelevel is executed by
rc to start daemons that must be run before the
security level changes. Following this,
rc then sets
the security level to the value specified in the
securelevel variable in that file. See
securelevel(7) for the
effects of setting the security level.
rc.firsttime exists, it is executed
once and then deleted. Any output is mailed to root.
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 end). Normally,
rc.local contains commands and daemons that are not
part of the stock installation.
rcnot to run fsck(8) during the next boot.
rcat boot time
rc command appeared in
|July 31, 2011||OpenBSD-5.1|