Page MenuHomeFreeBSD

D56898.diff
No OneTemporary

D56898.diff

diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist
--- a/etc/mtree/BSD.root.dist
+++ b/etc/mtree/BSD.root.dist
@@ -1,147 +0,0 @@
-#
-# Please see the file src/etc/mtree/README before making changes to this file.
-#
-
-/set type=dir uname=root gname=wheel mode=0755
-.
- bin tags=package=runtime
- ..
-/set tags=package=bootloader
- boot
- defaults
- ..
- dtb
- allwinner tags=package=runtime
- ..
- overlays tags=package=runtime
- ..
- rockchip tags=package=runtime
- ..
- ..
- efi
- ..
- firmware
- ..
- fonts
- ..
- images
- ..
- kernel
- ..
- loader.conf.d
- ..
- lua
- ..
- modules
- ..
- uboot
- ..
- zfs
- ..
- ..
-/unset tags
- dev mode=0555 tags=package=runtime
- ..
- etc tags=package=runtime
- X11 tags=package=runtime
- ..
- authpf tags=package=pf
- ..
- autofs tags=package=autofs
- ..
- bluetooth tags=package=bluetooth
- ..
- cron.d tags=package=cron
- ..
- defaults tags=package=runtime
- ..
- devd tags=package=devd
- ..
- dma tags=package=dma
- ..
- gss tags=package=runtime
- ..
- jail.conf.d tags=package=jail
- ..
- kyua tags=package=kyua
- ..
- mail tags=package=runtime
- ..
- mtree tags=package=mtree
- ..
- newsyslog.conf.d tags=package=newsyslog
- ..
- ntp mode=0700 tags=package=ntp
- ..
- pam.d tags=package=runtime
- ..
- periodic tags=package=periodic
- daily tags=package=periodic
- ..
- monthly tags=package=periodic
- ..
- security tags=package=periodic
- ..
- weekly tags=package=periodic
- ..
- ..
- pkg tags=package=pkg-bootstrap
- ..
- ppp tags=package=ppp
- ..
- profile.d tags=package=runtime
- ..
- rc.conf.d tags=package=rc
- ..
- rc.d tags=package=rc
- ..
- security tags=package=audit
- ..
- ssh tags=package=ssh
- ..
- ssl tags=package=caroot
- certs tags=package=caroot
- ..
- untrusted tags=package=caroot
- ..
- ..
- sysctl.kld.d tags=package=rc
- ..
- syslog.d tags=package=syslogd
- ..
- zfs tags=package=zfs
- compatibility.d tags=package=zfs
- ..
- ..
- ..
- lib tags=package=clibs
- geom tags=package=geom
- ..
- nvmecontrol tags=package=nvme-tools
- ..
- ..
- libexec tags=package=clibs
- resolvconf tags=package=resolvconf
- ..
- ..
- media tags=package=runtime
- ..
- mnt tags=package=runtime
- ..
- net tags=package=autofs
- ..
- proc mode=0555 tags=package=runtime
- ..
- rescue tags=package=rescue
- ..
- root mode=0750 tags=package=runtime
- ..
- sbin tags=package=runtime
- ..
- tmp mode=01777 tags=package=runtime
- ..
- usr tags=package=runtime
- ..
- var tags=package=runtime
- ..
-..
diff --git a/libexec/rc/rc.d/sysctl b/libexec/rc/rc.d/sysctl
--- a/libexec/rc/rc.d/sysctl
+++ b/libexec/rc/rc.d/sysctl
@@ -7,7 +7,7 @@
. /etc/rc.subr
name="sysctl"
-desc="Set sysctl variables from /etc/sysctl.conf and /etc/sysctl.conf.local"
+desc="Set sysctl variables from /etc/sysctl.conf, /etc/sysctl.conf.local and /etc/sysctl.conf.d/"
command="/sbin/sysctl"
stop_cmd=":"
start_cmd="sysctl_start"
@@ -26,7 +26,7 @@
;;
esac
- for _f in /etc/sysctl.conf /etc/sysctl.conf.local; do
+ for _f in /etc/sysctl.conf /etc/sysctl.conf.local /etc/sysctl.conf.d/*.conf; do
if [ -r ${_f} ]; then
${command} ${command_args} ${_f} > /dev/null
fi
diff --git a/sbin/sysctl/sysctl.conf b/sbin/sysctl/sysctl.conf
--- a/sbin/sysctl/sysctl.conf
+++ b/sbin/sysctl/sysctl.conf
@@ -1,7 +1,10 @@
#
-# This file is read when going to multi-user and its contents piped thru
-# ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details.
+# Refer to sysctl.conf(5) and sysctl(8) man pages for details on how to
+# configure kernel state.
#
+# The contents of /etc/sysctl.conf, /etc/sysctl.conf.local and any .conf
+# file(s) in the directory /etc/sysctl.conf.d are read by sysctl(8) when the
+# system transitions to multi-user operation.
# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
diff --git a/share/man/man5/sysctl.conf.5 b/share/man/man5/sysctl.conf.5
--- a/share/man/man5/sysctl.conf.5
+++ b/share/man/man5/sysctl.conf.5
@@ -22,20 +22,23 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd June 30, 2022
+.Dd May 18, 2026
.Dt SYSCTL.CONF 5
.Os
.Sh NAME
.Nm sysctl.conf
.Nd kernel state defaults
.Sh DESCRIPTION
-The
-.Pa /etc/sysctl.conf
-file is read in when the system goes into multi-user mode to set default
-settings for the kernel.
-The
-.Pa /etc/sysctl.conf
-file is in the format of the
+The files
+.Pa /etc/sysctl.conf ,
+.Pa /etc/sysctl.conf.local
+and any
+.Em .conf
+file in the directory
+.Pa /etc/sysctl.conf.d ,
+are read when the system goes into multi-user mode to set the default state of
+the kernel.
+The structure of these configuration files is in the format of the
.Xr sysctl 8
command, i.e.,
.Bd -literal -offset indent
@@ -50,6 +53,15 @@
.Sx EXAMPLES
section, below.
.Pp
+The directory
+.Pa /etc/sysctl.conf.d
+exists to reduce management burden of kernel settings cluttering a single
+configuration file by providing a mechanism to modularize those settings across
+any number of files.
+Possible scenarios for this use could be performance tuning or investigation,
+or separating out MIB node specific settings, or sharing common settings across
+a number of hosts.
+.Pp
For kernel modules loaded via
.Xr rc.subr 8
system,
@@ -74,6 +86,10 @@
.It Pa /etc/sysctl.conf.local
Machine-specific settings for sites with a common
.Pa /etc/sysctl.conf .
+.It Pa /etc/sysctl.conf.d
+Directory for modularized
+.Xr sysctl 8
+files.
.It Pa /etc/sysctl.kld.d
Module specific settings for kernel modules loaded via
.Xr rc.subr 8 .
@@ -92,8 +108,19 @@
.Sh HISTORY
The
.Nm
-file appeared in
-.Fx 4.0 .
+file first appeared in
+.Fx 4.0 ,
+.Sy sysctl.conf.local
+appeared in
+.Fx 8.0 ,
+the
+.Sy sysctl.kld.d
+directory appeared in
+.Fx 14.0 ,
+and the
+.Sy sysctl.conf.d
+directory appeared in
+.Fx 16.0 .
.Sh BUGS
If loadable kernel modules are used to introduce additional kernel
functionality and sysctls to manage that functionality,

File Metadata

Mime Type
text/plain
Expires
Sat, Aug 8, 7:13 PM (9 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36250655
Default Alt Text
D56898.diff (7 KB)

Event Timeline