RCCTL(8)

NAME
rcctl - configure and control daemons and services

SYNOPSIS
rcctl [-df] enable|disable|get|set|getdef|getall|order|action [service | daemon [variable [arguments]] | daemons]

DESCRIPTION
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 flags, status, timeout or user):

enable service | daemon
    Alias for “set service | daemon status on”.

disable service | daemon
    Alias for “set service | daemon status off”.

get service | daemon [variable]
    Display the value of service or daemon_variable. If variable is empty, display all service or daemon variables and values in a format compatible with rc.conf(8).

set service | daemon variable [arguments]
    For a daemon, set the variable daemon_variable to the specified arguments. If variable is already set, daemon_variable is reset to the optionally provided arguments or to its default value.

    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.

getdef service | daemon [variable]
    Like get but returns the default values.

getall
    Display all services and daemon variables with their values in a format compatible with rc.conf(8).

order [daemons]
    Move the specified package daemons to the beginning of pkg_scripts. They need to be already enabled. If daemons is empty, display the current order.

    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.

[-df] action daemon
    Run the rc.d(8) daemon script with the action argument, passing through the specified options, if any.

EXIT STATUS
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. Otherwise, the rcctl utility exits with 0 on success, and >0 if an error occurs (2 indicates a non-existent daemon | service).

EXAMPLES
Enable and set ntpd(8) flags:

    # rcctl set ntpd status on
    # rcctl set ntpd flags -s
    # rcctl get ntpd
    ntpd_flags=-s
    ntpd_timeout=30
    ntpd_user=root
    # echo $?
    0

SEE ALSO
rc.conf.local(8), rc.d(8)

HISTORY
rcctl first appeared in OpenBSD 5.7.

AUTHORS
rcctl was written by Antoine Jacoutot <ajacoutot@openbsd.org>.