directory contains shell scripts to
start, stop, and reconfigure daemon programs (“services”).
Services installed from
may be started at
boot time in the order specified by the
; the order will be
reversed during shutdown. Services comprising OpenBSD
base are started by rc(8)
The options are as follows:
- Setting this option will print the function names as they
are called and prevent the
rc.subr(8) framework from
redirecting stdin and stderr to /dev/null. This is used to allow debugging
of failed actions.
- This option only affects the
start action. It will forcibly start the
daemon whatever value daemon_flags is set
to. If daemon_flags is set to
“NO”, execution will continue with the script's own defaults
unless other flags are specified.
Each such script responds to the following
- Start the service, if not already running.
- Stop the service.
- Tell the daemon to reload its configuration.
- Perform a stop, then a start.
- Return 0 if the daemon is running or 1 if it is not.
Daemon control scripts use a fixed number of
variables when starting a
daemon. The following three can be overridden by site-specific values provided
- Additional arguments to call the daemon with. These will be
appended to any mandatory arguments already contained in the
daemon variable defined in the control
script. If daemon_flags is set to
“NO”, it will prevent the daemon from starting even when
listed in pkg_scripts.
- Routing table to run the daemon under, using
- Maximum time in seconds to wait for the
start (only if
rc_bg is set),
stop and reload
actions to return. This is only guaranteed with the default
- User to run the daemon as, using
To obtain the actual variable names, replace
with the name of the script. For
example, postgres is managed through
To override this and increase the debug log level (keeping the existing flags),
define the following in
postgresql_flags=-w -l /var/postgresql/logfile
Each script may define its own defaults, as explained in
is a special read-only variable.
It is set to “daemon” unless there is a login class configured in
with the same
name as the rc.d
script itself, in which case it
will be set to that login class. This allows setting many initial process
properties, for example environment variables, scheduling priority, and
process limits such as maximum memory use and number of files.
- Directory containing daemon control scripts.
- Functions and variables used by
- Directory containing files recording the variables of
currently running daemons. Some are informational and some are for
matching daemons using
directory first appeared in