Editing Sysrc

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 8: Line 8:
 
==Usage==
 
==Usage==
 
You can edit '''[[Rc.conf]]''' directly with a editor or with the command <code>sysrc</code> on the CLI. With <code>sysrc</code> you can alter '''[[Rc.conf]]''' safely.
 
You can edit '''[[Rc.conf]]''' directly with a editor or with the command <code>sysrc</code> on the CLI. With <code>sysrc</code> you can alter '''[[Rc.conf]]''' safely.
 
 
 
==Options==
 
 
{|class="wikitable" style="width:96.5%;background:#FFFFFF; border:2px solid #008000;text-align:left;padding: 10px"
 
|-
 
! scope="col" style="width: 100px;"|'''Option'''
 
! scope="col" style="width: 350px;"|'''Description'''
 
|-
 
|<nowiki>-a </nowiki>||Dump a list of all non-default configuration variables.
 
|-
 
|<nowiki>-A </nowiki>||Dump a list of all configuration variables (incl. defaults).
 
|-
 
|<nowiki>-c </nowiki> ||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.
 
|-
 
|<nowiki>-d</nowiki>||Print a description of the given variable.
 
|-
 
|<nowiki>-D</nowiki>||Show default value(s) only (this is the same as setting RC_CONFS  to NULL or passing `-f' with a NULL file-argument).
 
|-
 
|<nowiki>-e</nowiki>||Print query results as [https://www.freebsd.org/cgi/man.cgi?query=sh&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports sh(1)] compatible syntax (for example, `var=value').  Ignored if either `-n' or `-F' is specified.
 
|-
 
|<nowiki>-E</nowiki>||When given `-l' or `-L' to list configuration files, only list those that exist. When changing a setting, prefer to modify existing files.
 
|-
 
|<nowiki>-f </nowiki>''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.
 
|-
 
|<nowiki>-F</nowiki>||Show only the last '''[[Rc.conf|rc.conf(5)]]''' file each directive is in.
 
|-
 
|<nowiki>-h</nowiki>||Print a short usage message to stderr and exit.
 
|-
 
|<nowiki>--help</nowiki>||Print a full usage statement to stderr and exit.
 
|-
 
|<nowiki>-i</nowiki>||Ignore unknown variables.
 
|-
 
|<nowiki>-j </nowiki>''jail''||The jid or name of the jail to operate within (overrides `-R  dir'; requires [https://www.freebsd.org/cgi/man.cgi?query=jexec&sektion=8&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports jexec(8)]).
 
|-
 
|<nowiki>-l</nowiki>||List configuration files used at startup on stdout and exit.
 
|-
 
|<nowiki>-L</nowiki>||List all configuration files including '''[[Rc.conf.d|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.
 
|-
 
|<nowiki>-n</nowiki>||Show only variable values, not their names.
 
|-
 
|<nowiki>-N</nowiki>||Show only variable names, not their values.
 
|-
 
|<nowiki>-q</nowiki>||Quiet.  Disable verbose and hide certain errors. When combined      with `-L' and one or more name arguments, provide only exit status and no output.
 
|-
 
|<nowiki>-R </nowiki>''dir''||Operate within the root directory `dir' rather than `/'.
 
|-
 
|<nowiki>-s </nowiki>''name''||If an '''[[Rc.d|rc.d]]''' script of name exists (in'''/etc/[[Rc.d|rc.d]]''' or local_startup directories), process its '''[[Rc.conf.d|rc.conf.d]]''' entries as    potential overrides to `rc_conf_files'.  See rc.subr(8) for additional information on '''[[Rc.conf.d|rc.conf.d]]'''.  Can be combined with `-l'  to list configuration files used by service at startup.
 
|-
 
|<nowiki>-v</nowiki>||Verbose. Print the pathname of the specific '''[[Rc.conf|rc.conf(5)]]''' file  where the directive was found.
 
|-
 
|<nowiki>--version</nowiki>||Print version information to stdout and exit.
 
|-
 
|<nowiki>-x</nowiki>||Remove variable(s) from specified file(s).
 
|}
 
 
==Example==
 
  
 
With the <code>sysrc -a</code> you get information about all non-default settings in '''/etc/[[Rc.conf|rc.conf]]'''.
 
With the <code>sysrc -a</code> you get information about all non-default settings in '''/etc/[[Rc.conf|rc.conf]]'''.
  
 +
'''Example'''
 
$ sysrc -a<br/>
 
$ sysrc -a<br/>
 
autofs_enable: YES<br/>
 
autofs_enable: YES<br/>

Please note that all contributions to GhostBSD Wiki are considered to be released under the Creative Commons Attribution (see GhostBSD Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Templates used on this page: