From GhostBSD Wiki
Revision as of 16:11, 5 April 2020 by Slughorn (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Welcome to Icon Disti GhostBSD.png Sysrc.
rc - shell
The generic hook into OpenRC.
Ordering rc-scripts
Scripts to run OpenRC
Scripts to run OpenRC
Scripts automatically executed at boot and shutdown
Special scripts
Configuration file for devd(8)
Initscript Configuration Files
Smaller configuration files
Specifies the default settings for all the available options.
The global OpenRC configuration file
GhostBSD specific configurations
Safely edit system rc files
Shows which services are running
Add or delete services
Locate and run an OpenRC service
Back to the Icon Disti GhostBSD.pngSystem


The sysrc utility retrieves rc.conf(5) variables from the collection of system rc files and allows processes with appropriate privilege to change values in a safe and effective manner.


You can edit Rc.conf directly with a editor or with the command sysrc on the CLI. With sysrc you can alter Rc.conf safely.


Option Description
-a Dump a list of all non-default configuration variables.
-A Dump a list of all configuration variables (incl. defaults).
-c Check only. For querying, return success if all requested vari ables are set (even if NULL), otherwise return error status. For assignments, return success if no changes are required, otherwise failure. If verbose (see "-v") prints a message stating whether variables are set and/or changes are required.
-d Print a description of the given variable.
-D Show default value(s) only (this is the same as setting RC_CONFS to NULL or passing `-f' with a NULL file-argument).
-e Print query results as sh(1) compatible syntax (for example, `var=value'). Ignored if either `-n' or `-F' is specified.
-E When given `-l' or `-L' to list configuration files, only list those that exist. When changing a setting, prefer to modify existing files.
-f file Operate on the specified file(s) instead of the files obtained by reading the `rc_conf_files' entry in the RC_DEFAULTS file. This option can be specified multiple times for additional files.
-F Show only the last rc.conf(5) file each directive is in.
-h Print a short usage message to stderr and exit.
--help Print a full usage statement to stderr and exit.
-i Ignore unknown variables.
-j jail The jid or name of the jail to operate within (overrides `-R dir'; requires jexec(8)).
-l List configuration files used at startup on stdout and exit.
-L List all configuration files including rc.conf.d entries on stdout and exit. Can be combined with `-v' or `-e' to show service names. sysrc exits with success if all named services are installed, failure otherwise.
-n Show only variable values, not their names.
-N Show only variable names, not their values.
-q Quiet. Disable verbose and hide certain errors. When combined with `-L' and one or more name arguments, provide only exit status and no output.
-R dir Operate within the root directory `dir' rather than `/'.
-s name If an rc.d script of name exists (in/etc/rc.d or local_startup directories), process its rc.conf.d entries as potential overrides to `rc_conf_files'. See rc.subr(8) for additional information on rc.conf.d. Can be combined with `-l' to list configuration files used by service at startup.
-v Verbose. Print the pathname of the specific rc.conf(5) file where the directive was found.
--version Print version information to stdout and exit.
-x Remove variable(s) from specified file(s).


With the sysrc -a you get information about all non-default settings in /etc/rc.conf.

$ sysrc -a
autofs_enable: YES
cupsd_enable: YES
devfs_system_ruleset: devfsrules_common
dsbmd_enable: NO
hald_enable: YES
hostname: yourname.ghostbsd-pc.home
ifconfig_em0: DHCP
ifconfig_nfe0: DHCP
keymap: de.kbd
kld_list: linux linux64 cuse
kldload_nvidia: nvidia-modeset nvidia
kldload_vbox: vboxdrv
lpd_enable: NO
ntpd_sync_on_start: YES
root_rw_mount: NO
sendmail_enable: NONE
sendmail_msp_queue_enable: NO
sendmail_outbound_enable: NO
sendmail_submit_enable: NO
vboxguest_enable: YES
vboxnet_enable: YES
vboxservice_enable: YES