RCCTL(8) | System Manager's Manual | RCCTL(8) |
rcctl
— configure
and control daemons and services
rcctl |
get |getdef |set
service | daemon
[variable [arguments]] |
rcctl |
[-df ]
check |reload |restart |stop |start
daemon ... |
rcctl |
disable |enable |order
[daemon ...] |
rcctl |
ls
all |failed |on |off |rogue |started |stopped |
The rcctl
utility can enable or disable a
base system service or a base system or package
daemon in
rc.conf.local(8) or display its
configuration and status. For a daemon, it can also
change the command line arguments, the user to run as, the
rc.d(8) action timeout or call its
rc.d(8) daemon
control script.
The following commands are available
(variable can be one of class
,
execdir
, flags
,
logger
, rtable
,
status
, timeout
or
user
):
-df
] action daemon ...disable
service ... | daemon ...set
service|daemon
status off
.enable
service ... | daemon ...set
service|daemon
status on
.get
service | daemon
[variable]rcctl
will display all services and daemons
variables.getdef
service | daemon
[variable]get
but returns the default values.ls
lsargorder
[daemon ...]The order
command is only needed after
enabling a new daemon that needs to run before one or more already
enabled daemons. Specify the new daemon preceded by all that need to run
before it, but not the ones depending on it.
set
service | daemon variable
[arguments]The status
variable must be provided with the
on
or off
arguments. It is used to enable or disable
service or daemon in
rc.conf.local(8). When a
disabled package daemon is enabled, it is appended to the end of
pkg_scripts. When a package daemon is disabled, it
is removed from pkg_scripts and its variables are
removed if any.
rcctl
action returns
with the exit status of the rc.d(8)
daemon script. rcctl
get
daemon |
service [status
] exits with 0
if the daemon or service is enabled and 1 if it is not.
rcctl
getdef
daemon | service
[status
] exits with 0 if the daemon or service is
enabled by default and 1 if it is not. rcctl
ls failed
exits with 1 if an enabled daemon is not
running. Otherwise, the rcctl
utility exits with 0
on success, and >0 if an error occurs (2 indicates a non-existent
daemon | service).
Enable and set apmd(8) flags:
# rcctl set apmd status on # rcctl set apmd flags -A # rcctl get apmd apmd_class=daemon apmd_execdir= apmd_flags=NO apmd_logger= apmd_rtable=0 apmd_timeout=30 apmd_user=root # echo $? 0
The recommended way to run a second copy of a given daemon for a different purpose is to create a symbolic link to its rc.d(8) control script:
# ln -s /etc/rc.d/snmpd /etc/rc.d/snmpd6 # rcctl set snmpd6 status on # rcctl set snmpd6 flags -D addr=2001:db8::1234 # rcctl start snmpd6
rcctl
first appeared in
OpenBSD 5.7.
rcctl
was written by
Antoine Jacoutot
<ajacoutot@openbsd.org>.
May 26, 2022 | OpenBSD-current |