/etc/rc.subr: add support for kld sysctl variables
For kernel modules loaded by scripts in /etc/rc.d and /usr/local/etc/rc.d, if there is a file in /etc/sysctl.conf.d named <kld name>.conf, then this will be loaded using the sysctl(8) utility. For instance, sysctl variable changes for the pf kernel module would be placed in the file /etc/sysctl.conf.d/pf.conf. PR: 272129 Reviewed by: imp freebsd_igalic.co MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40886
This commit is contained in:
parent
f53b28c6df
commit
09267cc152
@ -96,6 +96,8 @@
|
||||
..
|
||||
ssl
|
||||
..
|
||||
sysctl.conf.d
|
||||
..
|
||||
syslog.d
|
||||
..
|
||||
zfs
|
||||
|
@ -1970,6 +1970,9 @@ load_kld()
|
||||
return 1
|
||||
else
|
||||
info "$1 kernel module loaded."
|
||||
if [ -f "/etc/sysctl.conf.d/$1.conf" ]; then
|
||||
sysctl -f "/etc/sysctl.conf.d/$1.conf"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
debug "load_kld: $1 kernel module already loaded."
|
||||
|
@ -51,6 +51,13 @@ Comments can also exist at the end of a line,
|
||||
as seen in the
|
||||
.Sx EXAMPLES
|
||||
section, below.
|
||||
.Pp
|
||||
For kernel modules loaded via
|
||||
.Xr rc.subr 8
|
||||
system ,
|
||||
additional module-specific settings can be applied
|
||||
by adding a file in the same format named
|
||||
.Pf /etc/sysctl.d/<module name>.conf .
|
||||
.Sh FILES
|
||||
.Bl -tag -width /etc/rc.d/sysctl_lastload -compact
|
||||
.It Pa /etc/rc.d/sysctl
|
||||
@ -69,6 +76,9 @@ Initial settings for
|
||||
.It Pa /etc/sysctl.conf.local
|
||||
Machine-specific settings for sites with a common
|
||||
.Pa /etc/sysctl.conf .
|
||||
.It Pa /etc/sysctl.conf.d
|
||||
Module specific settings for kernel modules loaded via
|
||||
.Xr rc.subr 8 .
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
To turn off logging of programs that exit due to fatal signals you may use
|
||||
|
Loading…
Reference in New Issue
Block a user