1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-01 12:19:28 +00:00

Parse sysctl settings from /etc/sysctl.conf.local after /etc/sysctl.conf

if it exists.  This mirrors similar behavior for /boot/loader.conf and
/etc/rc.conf.

Obtained from:	Yahoo!
MFC after:	1 week
This commit is contained in:
John Baldwin 2008-07-31 21:57:35 +00:00
parent 80794edc05
commit 4ceda705b7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181070

View File

@ -16,12 +16,12 @@ reload_cmd="sysctl_start"
lastload_cmd="sysctl_start last"
extra_commands="reload lastload"
sysctl_start()
#
# Read in a file containing sysctl settings and set things accordingly.
#
parse_file()
{
#
# Read in /etc/sysctl.conf and set things accordingly
#
if [ -f /etc/sysctl.conf ]; then
if [ -f $1 ]; then
while read var comments
do
case ${var} in
@ -36,19 +36,24 @@ sysctl_start()
${val})
;;
*)
if ! sysctl "${var}" >/dev/null 2>&1; then
warn "unable to set ${var}"
fi
sysctl "${var}"
;;
esac
elif [ "$1" = "last" ]; then
elif [ "$2" = "last" ]; then
warn "sysctl ${mib} does not exist."
fi
;;
esac
done < /etc/sysctl.conf
done < $1
fi
}
sysctl_start()
{
parse_file /etc/sysctl.conf $1
parse_file /etc/sysctl.conf.local $1
}
load_rc_config $name
run_rc_command "$1"