summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchris <chris@FreeBSD.org>2000-01-16 18:12:42 +0000
committerchris <chris@FreeBSD.org>2000-01-16 18:12:42 +0000
commit29fd6b6840e1f151ed18abe00cd191e6d7943c2e (patch)
tree79dc55c97c96ad390cd8ceeb182785780431408d
parent4338629a916cc92e6fe6710cca485f9eaa64e724 (diff)
downloadFreeBSD-src-29fd6b6840e1f151ed18abe00cd191e6d7943c2e.zip
FreeBSD-src-29fd6b6840e1f151ed18abe00cd191e6d7943c2e.tar.gz
Add and document support for handling comments and blank lines
in /etc/sysctl.conf. Reviewed by: imp, jkh
-rw-r--r--etc/rc.d/sysctl9
-rw-r--r--etc/rc.sysctl9
-rw-r--r--share/man/man5/sysctl.conf.510
3 files changed, 21 insertions, 7 deletions
diff --git a/etc/rc.d/sysctl b/etc/rc.d/sysctl
index 2c00357..1a5c48e 100644
--- a/etc/rc.d/sysctl
+++ b/etc/rc.d/sysctl
@@ -4,10 +4,13 @@
#
# $FreeBSD$
if [ -f /etc/sysctl.conf ]; then
- 3< /etc/sysctl.conf
- while read 0<&3 var;
+ sed '
+ /^[ ]*#/d
+ /^[ ]*$/d
+ s/#.*$//g
+ ' /etc/sysctl.conf |
+ while read var
do
sysctl -w ${var}
done
- 3<&-
fi
diff --git a/etc/rc.sysctl b/etc/rc.sysctl
index 2c00357..1a5c48e 100644
--- a/etc/rc.sysctl
+++ b/etc/rc.sysctl
@@ -4,10 +4,13 @@
#
# $FreeBSD$
if [ -f /etc/sysctl.conf ]; then
- 3< /etc/sysctl.conf
- while read 0<&3 var;
+ sed '
+ /^[ ]*#/d
+ /^[ ]*$/d
+ s/#.*$//g
+ ' /etc/sysctl.conf |
+ while read var
do
sysctl -w ${var}
done
- 3<&-
fi
diff --git a/share/man/man5/sysctl.conf.5 b/share/man/man5/sysctl.conf.5
index 08e6fb1..96cee10 100644
--- a/share/man/man5/sysctl.conf.5
+++ b/share/man/man5/sysctl.conf.5
@@ -42,6 +42,13 @@ command, i.e.
.Bd -literal -offset indent
sysctl_mib=value
.Ed
+.Pp
+Comments are denoted by a
+.Dq #
+at the beginning of a line. Comments can also exist at the end of a line,
+as seen in the
+.Sx EXAMPLES
+section, below.
.Sh FILES
.Bl -tag -width /etc/sysctl.conf -compact
.It Pa /etc/sysctl.conf
@@ -52,7 +59,8 @@ To turn off logging of programs that exit due to fatal signals, as well as
telling Linux programs that you are running FreeBSD 3.4-STABLE, you may use
a configuration like
.Bd -literal -offset indent
-kern.logsigexit=0
+# Configure logging and Linux execution.
+kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11)
compat.linux.osname=FreeBSD
compat.linux.osrelease=3.4-STABLE
.Ed
OpenPOWER on IntegriCloud