Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2022 13:03:54 +0000
From:      bugzilla-noreply@freebsd.org
To:        doc@FreeBSD.org
Subject:   [Bug 263782] Use sysrc instead of manually editing rc.conf throughout the FreeBSD Handbook for simplicity and consistency
Message-ID:  <bug-263782-9-eaILl3XpfJ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-263782-9@https.bugs.freebsd.org/bugzilla/>
References:  <bug-263782-9@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263782

--- Comment #12 from PauAmma <pauamma@gundo.com> ---
Comment on attachment 233821
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D233821
combined sysrc with first patch and then combined the two patches

>diff --git a/documentation/content/en/books/handbook/x11/_index.adoc b/doc=
umentation/content/en/books/handbook/x11/_index.adoc
>index 8a9269cdcf..9aa05ef7a9 100644
>--- a/documentation/content/en/books/handbook/x11/_index.adoc
>+++ b/documentation/content/en/books/handbook/x11/_index.adoc

>+sysrc xdm_enable=3D"YES"

Needs # prefix

>+sysrc dbus_enable=3D"YES"

Needs # prefix

>diff --git a/documentation/content/en/books/handbook/config/_index.adoc b/=
documentation/content/en/books/handbook/config/_index.adoc
>index 5fcc5a350f..95ed64cc68 100644
>--- a/documentation/content/en/books/handbook/config/_index.adoc
>+++ b/documentation/content/en/books/handbook/config/_index.adoc
>@@ -56,7 +56,7 @@ This chapter explains much of the FreeBSD configuration =
process, including some
>=20
> After reading this chapter, you will know:
>=20
>-* The basics of [.filename]#rc.conf# configuration and [.filename]#/usr/l=
ocal/etc/rc.d# startup scripts.
>+* The basics of [.filename]#rc.conf# configuration with man:sysrc[8] and =
[.filename]#/usr/local/etc/rc.d# startup scripts.
> * How to configure and test a network card.
> * How to configure virtual hosts on network devices.
> * How to use the various configuration files in [.filename]#/etc#.
>@@ -80,7 +80,7 @@ In FreeBSD, most included services, such as man:cron[8],=
 are started through the
> =3D=3D=3D Extended Application Configuration
>=20
> Now that FreeBSD includes [.filename]#rc.d#, configuration of application=
 startup is easier and provides more features.
>-Using the key words discussed in <<configtuning-rcd>>, applications can b=
e set to start after certain other services and extra flags can be passed t=
hrough [.filename]#/etc/rc.conf# in place of hard coded flags in the startu=
p script.
>+Using the key words discussed in <<configtuning-rcd>>, applications can b=
e set to start after certain other services and extra flags can be passed t=
hrough man:sysrc[8] in place of hard coded flags in the startup script.
> A basic script may look similar to the following:
>=20
> [.programlisting]
>@@ -113,14 +113,14 @@ run_rc_command "$1"
> This script will ensure that the provided `utility` will be started after=
 the `DAEMON` pseudo-service.
> It also provides a method for setting and tracking the process ID (PID).
>=20
>-This application could then have the following line placed in [.filename]=
#/etc/rc.conf#:
>+This application could then be enabled with man:sysrc[8]:
>=20
> [.programlisting]
> ....
>-utility_enable=3D"YES"
>+# sysrc utility_enable=3D"YES"
> ....
>=20
>-This method allows for easier manipulation of command line arguments, inc=
lusion of the default functions provided in [.filename]#/etc/rc.subr#, comp=
atibility with man:rcorder[8], and provides for easier configuration via [.=
filename]#rc.conf#.
>+This method allows for easier manipulation of command line arguments, inc=
lusion of the default functions provided in [.filename]#/etc/rc.subr#, comp=
atibility with man:rcorder[8], and provides for easier configuration via ma=
n:sysrc[8].
>=20
> =3D=3D=3D Using Services to Start Services
>=20
>@@ -255,14 +255,13 @@ For instance, man:sshd[8] can be restarted with the =
following command:
>=20
> This procedure can be used to start services on a running system.
> Services will be started automatically at boot time as specified in man:r=
c.conf[5].
>-For example, to enable man:natd[8] at system startup, add the following l=
ine to [.filename]#/etc/rc.conf#:
>+For example, to enable man:natd[8] at system startup, use man:sysrc[8]:
>=20
> [.programlisting]
> ....
>-natd_enable=3D"YES"
>+# sysrc natd_enable=3D"YES"
> ....
>=20
>-If a `natd_enable=3D"NO"` line is already present, change the `NO` to `YE=
S`.
> The man:rc[8] scripts will automatically load any dependent services duri=
ng the next boot, as described below.
>=20
> Since the man:rc[8] system is primarily intended to start and stop servic=
es at system startup and shutdown time, the `start`, `stop` and `restart` o=
ptions will only perform their action if the appropriate [.filename]#/etc/r=
c.conf# variable is set.
>@@ -561,12 +560,12 @@ dc0: flags=3D8843<BROADCAST,SIMPLEX,MULTICAST> metri=
c 0 mtu 1500
> it would indicate the card has not been configured.
>=20
> The card must be configured as `root`.
>-The NIC configuration can be performed from the command line with man:ifc=
onfig[8] but will not persist after a reboot unless the configuration is al=
so added to [.filename]#/etc/rc.conf#.
>+The NIC configuration can be performed from the command line with man:ifc=
onfig[8] but will not persist after a reboot unless the configuration is al=
so modified with man:sysrc[8].
> If a DHCP server is present on the LAN, just add this line:
>=20
> [.programlisting]
> ....
>-ifconfig_dc0=3D"DHCP"
>+# sysrc ifconfig_dc0=3D"DHCP"
> ....
>=20
> Replace _dc0_ with the correct value for the system.
>@@ -948,12 +947,12 @@ This example adds the hostname of `B`, logs all faci=
lities, and stores the log e
> When adding multiple log clients, add a similar two-line entry for each c=
lient.
> More information about the available facilities may be found in man:syslo=
g.conf[5].
>=20
>-Next, configure [.filename]#/etc/rc.conf#:
>+Next, configure with man:sysrc[8]:
>=20
> [.programlisting]
> ....
>-syslogd_enable=3D"YES"
>-syslogd_flags=3D"-a logclient.example.com -v -v"
>+# sysrc syslogd_enable=3D"YES"
>+# sysrc syslogd_flags=3D"-a logclient.example.com -v -v"
> ....
>=20
> The first entry starts syslogd at system boot.
>@@ -988,12 +987,12 @@ If the server did not restart, consult [.filename]#/=
var/log/messages# for the er
> A logging client sends log entries to a logging server on the network.
> The client also keeps a local copy of its own logs.
>=20
>-Once a logging server has been configured, edit [.filename]#/etc/rc.conf#=
 on the logging client:
>+Once a logging server has been configured, use man:sysrc[8] to enable the=
 logging client:
>=20
> [.programlisting]
> ....
>-syslogd_enable=3D"YES"
>-syslogd_flags=3D"-s -v -v"
>+# sysrc syslogd_enable=3D"YES"
>+# sysrc syslogd_flags=3D"-s -v -v"
> ....
>=20
> The first entry enables syslogd on boot up.
>diff --git a/documentation/content/en/books/handbook/firewalls/_index.adoc=
 b/documentation/content/en/books/handbook/firewalls/_index.adoc
>index ec3bc64543..e8fe2c55cb 100644
>--- a/documentation/content/en/books/handbook/firewalls/_index.adoc
>+++ b/documentation/content/en/books/handbook/firewalls/_index.adoc
>@@ -182,9 +182,8 @@ It also provides several examples for creating ruleset=
s on a FreeBSD system.
> =3D=3D=3D Enabling PF
>=20
> To use PF, its kernel module must be first loaded.
>-This section describes the entries that can be added to [.filename]#/etc/=
rc.conf# to enable PF.
>+This section describes the entries that can be added:
>=20
>-Start by adding `pf_enable=3Dyes` to [.filename]#/etc/rc.conf#:
>=20
> [source,shell]
> ....
>@@ -192,7 +191,7 @@ Start by adding `pf_enable=3Dyes` to [.filename]#/etc/=
rc.conf#:
> ....
>=20
> Additional options, described in man:pfctl[8], can be passed to PF when i=
t is started.
>-Add or change this entry in [.filename]#/etc/rc.conf# and specify any req=
uired flags between the two quotes (`""`):
>+Use man:sysrc[8] to specify any required flags between the two quotes (`"=
"`):
>=20
> [.programlisting]
> ....
>@@ -202,7 +201,7 @@ pf_flags=3D""                     # additional flags f=
or pfctl startup
> PF will not start if it cannot find its ruleset configuration file.
> By default, FreeBSD does not ship with a ruleset and there is no [.filena=
me]#/etc/pf.conf#.
> Example rulesets can be found in [.filename]#/usr/share/examples/pf/#.
>-If a custom ruleset has been saved somewhere else, add a line to [.filena=
me]#/etc/rc.conf# which specifies the full path to the file:
>+If a custom ruleset has been saved somewhere else, use man:sysrc[8] to sp=
ecify a line to specify the full path to the file:
>=20
> [.programlisting]
> ....
>@@ -210,7 +209,7 @@ pf_rules=3D"/path/to/pf.conf"
> ....
>=20
> Logging support for PF is provided by man:pflog[4].
>-To enable logging support, add `pflog_enable=3Dyes` to [.filename]#/etc/r=
c.conf#:
>+To enable logging support, add `pflog_enable=3Dyes` with man:sysrc[8]:
>=20
> [source,shell]
> ....
>diff --git a/documentation/content/en/books/handbook/linuxemu/_index.adoc =
b/documentation/content/en/books/handbook/linuxemu/_index.adoc
>index 8b46e6444f..d0387ee3c8 100644
>--- a/documentation/content/en/books/handbook/linuxemu/_index.adoc
>+++ b/documentation/content/en/books/handbook/linuxemu/_index.adoc
>@@ -71,11 +71,11 @@ Before reading this chapter, you should:
> =3D=3D Configuring Linux Binary Compatibility
>=20
> By default, Linux binary compatibility is not enabled.
>-To enable it at boot time, add this line to [.filename]#/etc/rc.conf#:
>+To enable it at boot time, use man:sysrc[8]:
>=20
> [.programlisting]
> ....
>-linux_enable=3D"YES"
>+# sysrc linux_enable=3D"YES"
> ....
>=20
> Once enabled, it can be started without rebooting by running:
>@@ -149,11 +149,11 @@ Consult https://wiki.freebsd.org/Linuxulator[FreeBSD=
 Wiki - Linuxulator] for mor
> A list of all Linux-related man:sysctl[8] knobs can be found in man:linux=
[4].
>=20
> Some applications require specific filesystems to be mounted.
>-This is normally handled by the [.filename]#/etc/rc.d/linux# script, but =
can be disabled by adding this line to [.filename]#/etc/rc.conf#:
>+This is normally handled by the [.filename]#/etc/rc.d/linux# script, but =
can be disabled by using man:sysrc[8]:
>=20
> [.programlisting]
> ....
>-linux_mounts_enable=3D"NO"
>+# sysrc linux_mounts_enable=3D"NO"
> ....
>=20
> Filesystems mounted by the rc script will not work for Linux processes in=
side chroots or jails; if needed, configure them in [.filename]#/etc/fstab#:
>diff --git a/documentation/content/en/books/handbook/multimedia/_index.ado=
c b/documentation/content/en/books/handbook/multimedia/_index.adoc
>index 37d7669dc8..742b3d9c42 100644
>--- a/documentation/content/en/books/handbook/multimedia/_index.adoc
>+++ b/documentation/content/en/books/handbook/multimedia/_index.adoc
>@@ -1225,11 +1225,11 @@ add path 'usb/*' mode 0666 group usb
>=20
> Refer to man:devfs.rules[5] for more information about this file.
>=20
>-Next, enable the ruleset in /etc/rc.conf:
>+Next, enable the ruleset with man:sysrc[8]:
>=20
> [.programlisting]
> ....
>-devfs_system_ruleset=3D"system"
>+# sysrc devfs_system_ruleset=3D"system"
> ....
>=20
> And, restart the man:devfs[8] system:
>diff --git a/documentation/content/en/books/handbook/ports/_index.adoc b/d=
ocumentation/content/en/books/handbook/ports/_index.adoc
>index cfe881e847..9ccd1daec9 100644
>--- a/documentation/content/en/books/handbook/ports/_index.adoc
>+++ b/documentation/content/en/books/handbook/ports/_index.adoc
>@@ -1309,7 +1309,7 @@ The following commands and locations can be used to =
help determine what was inst
>=20
> * Most applications install at least one default configuration file in [.=
filename]#/usr/local/etc#. In cases where an application has a large number=
 of configuration files, a subdirectory will be created to hold them. Often=
, sample configuration files are installed which end with a suffix such as =
[.filename]#.sample#. The configuration files should be reviewed and possib=
ly edited to meet the system's needs. To edit a sample file, first copy it =
without the [.filename]#.sample# extension.
> * Applications which provide documentation will install it into [.filenam=
e]#/usr/local/share/doc# and many applications also install manual pages. T=
his documentation should be consulted before continuing.
>-* Some applications run services which must be added to [.filename]#/etc/=
rc.conf# before starting the application. These applications usually instal=
l a startup script in [.filename]#/usr/local/etc/rc.d#. See crossref:config=
[configtuning-starting-services,Starting Services] for more information.
>+* Some applications run services which must be added to [.filename]#/etc/=
rc.conf# with https://www.freebsd.org/cgi/man.cgi?query=3Dsysrc[sysrc] befo=
re starting the application. These applications usually install a startup s=
cript in [.filename]#/usr/local/etc/rc.d#. See crossref:config[configtuning=
-starting-services,Starting Services] for more information.
> +
> [NOTE]
> =3D=3D=3D=3D
>diff --git a/documentation/content/en/books/handbook/printing/_index.adoc =
b/documentation/content/en/books/handbook/printing/_index.adoc
>index e8b92039c5..63fe07fee4 100644
>--- a/documentation/content/en/books/handbook/printing/_index.adoc
>+++ b/documentation/content/en/books/handbook/printing/_index.adoc
>@@ -100,11 +100,11 @@ For a printer connected directly to a network, use:
> +
> Replace _network-printer-name_ with the `DNS` host name of the network pr=
inter.
> +
>-. Enable LPD by editing [.filename]#/etc/rc.conf#, adding this line:
>+. Enable LPD by editing by using man:sysrc[8]:
> +
> [.programlisting]
> ....
>-lpd_enable=3D"YES"
>+# sysrc lpd_enable=3D"YES"
> ....
> +
> Start the service:
>@@ -375,11 +375,11 @@ After creating [.filename]#/etc/printcap#, use man:c=
hkprintcap[8] to test it for
>=20
> Fix any reported problems before continuing.
>=20
>-Enable man:lpd[8] in [.filename]#/etc/rc.conf#:
>+Enable man:lpd[8] using man:sysrc[8]:
>=20
> [.programlisting]
> ....
>-lpd_enable=3D"YES"
>+# sysrc lpd_enable=3D"YES"
> ....
>=20
> Start the service:
>diff --git a/documentation/content/en/books/handbook/x11/_index.adoc b/doc=
umentation/content/en/books/handbook/x11/_index.adoc
>index 9aa05ef7a9..881fc862e4 100644
>--- a/documentation/content/en/books/handbook/x11/_index.adoc
>+++ b/documentation/content/en/books/handbook/x11/_index.adoc

>+sysrc gdm_enable=3D"YES"

Needs # prefix

>+sysrc gnome_enable=3D"YES"

Needs # prefix

>+sysrc dbus_enable=3D"YES"

Needs # prefix

>+sysrc sddm_enable=3D"YES"

Needs # prefix

>+sysrc dbus_enable=3D"YES"

Needs # prefix

>diff --git a/documentation/content/en/books/handbook/basics/_index.adoc b/=
documentation/content/en/books/handbook/basics/_index.adoc
>index aa6583ca95..66caeee406 100644
>--- a/documentation/content/en/books/handbook/basics/_index.adoc
>+++ b/documentation/content/en/books/handbook/basics/_index.adoc

>+sysrc allscreens_flags=3D"MODE_279"

Needs # prefix

>diff --git a/documentation/content/en/books/handbook/config/_index.adoc b/=
documentation/content/en/books/handbook/config/_index.adoc
>index 5fcc5a350f..19cdeea129 100644
>--- a/documentation/content/en/books/handbook/config/_index.adoc
>+++ b/documentation/content/en/books/handbook/config/_index.adoc

>+sysrc utility_enable=3D"YES"

Needs # prefix

>+sysrc natd_enable=3D"YES"

Needs # prefix

>+sysrc ifconfig_dc0=3D"DHCP"

Needs # prefix

>+sysrc syslogd_enable=3D"YES"
>+sysrc syslogd_flags=3D"-a logclient.example.com -v -v"

Need # prefix

>+sysrc syslogd_enable=3D"YES"
>+sysrc syslogd_flags=3D"-s -v -v"

Need # prefix

>diff --git a/documentation/content/en/books/handbook/linuxemu/_index.adoc =
b/documentation/content/en/books/handbook/linuxemu/_index.adoc
>index 8b46e6444f..8931f2892c 100644
>--- a/documentation/content/en/books/handbook/linuxemu/_index.adoc
>+++ b/documentation/content/en/books/handbook/linuxemu/_index.adoc

>+sysrc linux_enable=3D"YES"

Needs # prefix

>+sysrc linux_mounts_enable=3D"NO"

Needs # prefix

>diff --git a/documentation/content/en/books/handbook/multimedia/_index.ado=
c b/documentation/content/en/books/handbook/multimedia/_index.adoc
>index 37d7669dc8..922a0ec75c 100644
>--- a/documentation/content/en/books/handbook/multimedia/_index.adoc
>+++ b/documentation/content/en/books/handbook/multimedia/_index.adoc
>+sysrc devfs_system_ruleset=3D"system"

Needs # prefix

>diff --git a/documentation/content/en/books/handbook/printing/_index.adoc =
b/documentation/content/en/books/handbook/printing/_index.adoc
>index e8b92039c5..a64ee33632 100644
>--- a/documentation/content/en/books/handbook/printing/_index.adoc
>+++ b/documentation/content/en/books/handbook/printing/_index.adoc

>+sysrc lpd_enable=3D"YES"

Needs # prefix

>+sysrc lpd_enable=3D"YES"

Needs # prefix

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-263782-9-eaILl3XpfJ>