Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/sysrc/sysrc.8
Show All 18 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd September 2, 2015 | .Dd September 12, 2015 | ||||
.Dt SYSRC 8 | .Dt SYSRC 8 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm sysrc | .Nm sysrc | ||||
.Nd safely edit system rc files | .Nd safely edit system rc files | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl cdDeFhinNqvx | .Op Fl cdDeEFhinNqvx | ||||
.Op Fl s Ar name | |||||
.Op Fl f Ar file | .Op Fl f Ar file | ||||
.Op Fl j Ar jail | Fl R Ar dir | .Op Fl j Ar jail | Fl R Ar dir | ||||
.Ar name Ns Op Ns Oo +|- Oc Ns = Ns Ar value | .Ar name Ns Op Ns Oo +|- Oc Ns = Ns Ar value | ||||
.Ar ... | .Ar ... | ||||
.Nm | .Nm | ||||
.Op Fl cdDeFhinNqvx | .Op Fl cdDeEFhinNqvx | ||||
.Op Fl s Ar name | |||||
.Op Fl f Ar file | .Op Fl f Ar file | ||||
.Op Fl j Ar jail | Fl R Ar dir | .Op Fl j Ar jail | Fl R Ar dir | ||||
.Fl a | A | .Fl a | A | ||||
.Nm | |||||
.Op Fl E | |||||
.Op Fl s Ar name | |||||
.Op Fl f Ar file | |||||
.Fl l | |||||
.Nm | |||||
.Op Fl eEv | |||||
.Fl L | |||||
.Op Ar name ... | |||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility retrieves | utility retrieves | ||||
.Xr rc.conf 5 | .Xr rc.conf 5 | ||||
variables from the collection of system rc files and allows processes with | variables from the collection of system rc files and allows processes with | ||||
appropriate privilege to change values in a safe and effective manner. | appropriate privilege to change values in a safe and effective manner. | ||||
.Pp | .Pp | ||||
Show All 23 Lines | |||||
.Xr sh 1 | .Xr sh 1 | ||||
compatible syntax | compatible syntax | ||||
.Pq for example, Ql var=value . | .Pq for example, Ql var=value . | ||||
Ignored if either | Ignored if either | ||||
.Ql Fl n | .Ql Fl n | ||||
or | or | ||||
.Ql Fl F | .Ql Fl F | ||||
is specified. | is specified. | ||||
.It Fl E | |||||
When given | |||||
.Sq Fl l | |||||
or | |||||
.Sq Fl L | |||||
to list configuration files, only list those that exist. | |||||
When changing a setting, prefer to modify existing files. | |||||
.It Fl f Ar file | .It Fl f Ar file | ||||
Operate on the specified file(s) instead of the files obtained by reading the | Operate on the specified file(s) instead of the files obtained by reading the | ||||
.Sq rc_conf_files | .Sq rc_conf_files | ||||
entry in the | entry in the | ||||
.Ev RC_DEFAULTS | .Ev RC_DEFAULTS | ||||
file. | file. | ||||
This option can be specified multiple times for additional files. | This option can be specified multiple times for additional files. | ||||
.It Fl F | .It Fl F | ||||
Show only the last | Show only the last | ||||
.Xr rc.conf 5 | .Xr rc.conf 5 | ||||
file each directive is in. | file each directive is in. | ||||
.It Fl h | .It Fl h | ||||
Print a short usage message to stderr and exit. | Print a short usage message to stderr and exit. | ||||
.It Fl -help | .It Fl -help | ||||
Print a full usage statement to stderr and exit. | Print a full usage statement to stderr and exit. | ||||
.It Fl i | .It Fl i | ||||
Ignore unknown variables. | Ignore unknown variables. | ||||
.It Fl j Ar jail | .It Fl j Ar jail | ||||
The | The | ||||
.Ar jid | .Ar jid | ||||
or name of the | or name of the | ||||
.Ar jail | .Ar jail | ||||
to operate within | to operate within | ||||
.Pq overrides So Fl R Ar dir Sc ; requires Xr jexec 8 . | .Pq overrides So Fl R Ar dir Sc ; requires Xr jexec 8 . | ||||
.It Fl l | |||||
List configuration files used at startup on stdout and exit. | |||||
.It Fl L | |||||
List all configuration files including rc.conf.d entries on stdout and exit. | |||||
Can be combined with | |||||
.Sq Fl v | |||||
or | |||||
.Sq Fl e | |||||
to show service names. | |||||
.It Fl n | .It Fl n | ||||
Show only variable values, not their names. | Show only variable values, not their names. | ||||
.It Fl N | .It Fl N | ||||
Show only variable names, not their values. | Show only variable names, not their values. | ||||
.It Fl q | .It Fl q | ||||
Quiet. | Quiet. | ||||
Disable verbose and hide certain errors. | Disable verbose and hide certain errors. | ||||
.It Fl R Ar dir | .It Fl R Ar dir | ||||
Operate within the root directory | Operate within the root directory | ||||
.Sq Ar dir | .Sq Ar dir | ||||
rather than | rather than | ||||
.Sq / . | .Sq / . | ||||
.It Fl s Ar name | |||||
If an | |||||
.Li rc.d | |||||
script of | |||||
.Ar name | |||||
exists | |||||
.Po | |||||
in | |||||
.Dq /etc/rc.d | |||||
or | |||||
.Li local_startup | |||||
directories | |||||
.Pc , | |||||
process its | |||||
.Dq rc.conf.d | |||||
entries as potential overrides to | |||||
.Sq rc_conf_files . | |||||
See | |||||
.Xr rc.subr 8 | |||||
for additional information on | |||||
.Dq rc.conf.d . | |||||
Can be combined with | |||||
.Sq Fl l | |||||
to list configuration files used by service at startup. | |||||
.It Fl v | .It Fl v | ||||
Verbose. | Verbose. | ||||
Print the pathname of the specific | Print the pathname of the specific | ||||
.Xr rc.conf 5 | .Xr rc.conf 5 | ||||
file where the directive was found. | file where the directive was found. | ||||
.It Fl -version | .It Fl -version | ||||
Print version information to stdout and exit. | Print version information to stdout and exit. | ||||
.It Fl x | .It Fl x | ||||
▲ Show 20 Lines • Show All 203 Lines • ▼ Show 20 Lines | |||||
.Xr chown 8 | .Xr chown 8 | ||||
and | and | ||||
.Xr jexec 8 . | .Xr jexec 8 . | ||||
.Sh FILES | .Sh FILES | ||||
.Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact | .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact | ||||
.It Pa /etc/defaults/rc.conf | .It Pa /etc/defaults/rc.conf | ||||
.It Pa /etc/rc.conf | .It Pa /etc/rc.conf | ||||
.It Pa /etc/rc.conf.local | .It Pa /etc/rc.conf.local | ||||
.It Pa /etc/rc.conf.d/name | |||||
.It Pa /etc/rc.conf.d/name/* | |||||
.It Pa /usr/local/etc/rc.conf.d/name | |||||
.It Pa /usr/local/etc/rc.conf.d/name/* | |||||
.El | .El | ||||
.Sh EXAMPLES | .Sh EXAMPLES | ||||
Below are some simple examples of how | Below are some simple examples of how | ||||
.Nm | .Nm | ||||
can be used to query certain values from the | can be used to query certain values from the | ||||
.Xr rc.conf 5 | .Xr rc.conf 5 | ||||
collection of system configuration files: | collection of system configuration files: | ||||
.Pp | .Pp | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
.Dl returns $usbd_flags or "default" if unset or NULL . | .Dl returns $usbd_flags or "default" if unset or NULL . | ||||
.Pp | .Pp | ||||
.Nm | .Nm | ||||
cloned_interfaces+"alternate" | cloned_interfaces+"alternate" | ||||
.Dl returns "alternate" if $cloned_interfaces is set . | .Dl returns "alternate" if $cloned_interfaces is set . | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr jls 1 , | .Xr jls 1 , | ||||
.Xr rc.conf 5 , | .Xr rc.conf 5 , | ||||
.Xr rc.subr 8 , | |||||
.Xr jail 8 , | .Xr jail 8 , | ||||
.Xr jexec 8 , | .Xr jexec 8 , | ||||
.Xr rc 8 , | .Xr rc 8 , | ||||
.Xr sysctl 8 | .Xr sysctl 8 | ||||
.Sh HISTORY | .Sh HISTORY | ||||
A | A | ||||
.Nm | .Nm | ||||
utility first appeared in | utility first appeared in | ||||
.Fx 9.2 . | .Fx 9.2 . | ||||
.Sh AUTHORS | .Sh AUTHORS | ||||
.An Devin Teske Aq Mt dteske@FreeBSD.org | .An Devin Teske Aq Mt dteske@FreeBSD.org | ||||
.Sh THANKS TO | .Sh THANKS TO | ||||
Brandon Gooch, Garrett Cooper, Julian Elischer, Pawel Jakub Dawidek, | Brandon Gooch, Garrett Cooper, Julian Elischer, Pawel Jakub Dawidek, | ||||
Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, | Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, | ||||
Allan Jude, and Lars Engels for suggestions, help, and testing. | Allan Jude, and Lars Engels for suggestions, help, and testing. |