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 @@ -96,6 +96,8 @@ .. ssl .. + sysctl.conf.d + .. syslog.d .. zfs diff --git a/libexec/rc/rc.d/kld b/libexec/rc/rc.d/kld --- a/libexec/rc/rc.d/kld +++ b/libexec/rc/rc.d/kld @@ -48,6 +48,9 @@ echo 'Loading kernel modules:' for _kld in $kld_list ; do load_kld -e ${_kld}.ko $_kld + if [ -f "/etc/sysctl.conf.d/${_kld}.conf" ]; then + sysctl -f /etc/sysctl.conf.d/${_kld}.conf + fi done } 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 @@ -51,6 +51,14 @@ as seen in the .Sx EXAMPLES section, below. +.Pp +For kernel modules loaded via the +.Va kld_list +variable in +.Pa /etc/rc.conf , +additional module-specific settings can be applied +by adding a file in the same format named +.Pf /etc/sysctl.d/.conf . .Sh FILES .Bl -tag -width /etc/rc.d/sysctl_lastload -compact .It Pa /etc/rc.d/sysctl @@ -69,6 +77,9 @@ .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 +.Va kld_list . .El .Sh EXAMPLES To turn off logging of programs that exit due to fatal signals you may use