rc(8)

NAME

rc - command scripts for system startup

SYNOPSIS

/etc/rc
/etc/rc.local
/etc/rc.securelevel

DESCRIPTION

rc is the command script that is invoked by init(8) during
an automatic
reboot and after single user mode is exited; it performs
system house
keeping chores and starts up system daemons. Additionally,
rc is intri
cately tied to the netstart(8) script, which runs commands
and daemons
pertaining to the network. The rc.securelevel and rc.local
scripts hold
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.lo
cal(8), which
specify which daemons and services to run.
When an automatic reboot is in progress, rc is invoked with
the argument
autoboot. The first portion of rc runs an fsck(8) with op
tion -p to
``preen'' all disks of minor inconsistencies resulting from
the last sys
tem shutdown and to check for serious inconsistencies caused
by hardware
or software failure. If this auto-check and repair suc
ceeds, then the
second part of rc is run.
However, if the file /fastboot exists, fsck(8) will not be
invoked during
this boot. This file is then removed so that it will be run
on subse
quent boots.
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 init(8)),
then asks rc.conf(8) for configuration variables, mounts
filesystems,
starts system daemons, preserves editor files, clears the
scratch direc
tory /tmp, and saves any possible core image that might have
been gener
ated as a result of a system crash, with savecore(8).
Before rc starts most system daemons, netstart(8) is execut
ed.
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.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). Nor
mally, rc.local contains commands and daemons that are not
part of the
stock installation.

CONFIGURATION EXAMPLES

The rc.conf(8) file contains a series of Bourne-shell syntax
assignments
that are used to configure kernel configurations, network
configuration,
and various other system daemons. As described above, this
file is
sourced (using sh(1) of course) by /etc/rc. Various com
ments in
rc.conf(8) make it clear what each variable does. Refer to
the specific
man pages for each daemon to determine what that subsystem
does.
For example, the lpd(8) daemon is controlled by the follow
ing line:

lpd_flags=NO # for normal use: "" (or "-l" for
debugging)
This does not start lpd(8) at system startup. To start
lpd(8), the fol
lowing entry can be used:

lpd_flags="" # for normal use: "" (or "-l" for
debugging)
Alternately, lpd(8) can be started with the -l flag (to log
remote con
nections):

lpd_flags="-l" # for normal use: "" (or "-l" for
debugging)

EXTERNAL INFLUENCES

Before init(8) starts rc, it sets the process priority,
umask, and
resource limits according to the ``daemon'' login class as
described in
login.conf(5).

FILES

/etc/rc Command scripts for system startup.
/etc/rc.local Site specific command scripts for
system startup.
/etc/rc.conf System daemon configuration database.
/etc/rc.conf.local Site specific daemon configuration
database.
/etc/rc.securelevel Commands run before the security lev
el changes.
/etc/rc.shutdown Commands run at system shutdown.
/etc/login.conf Login class capability database.
/etc/netstart Command script for network startup.

SEE ALSO

login.conf(5), sysctl.conf(5), securelevel(7), init(8), net
start(8),
rc.conf(8), rc.shutdown(8), reboot(8), savecore(8)

HISTORY

The rc command appeared in 4.0BSD.
BSD December 11, 1993
Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout