sysctl.linux.in: use the --system option

According to the sysctl man page, the --system option causes sysctl to
process all system configuration files, which include the following:

/run/sysctl.d/*.conf
/etc/sysctl.d/*.conf
/usr/local/lib/sysctl.d/*.conf
/usr/lib/sysctl.d/*.conf
/lib/sysctl.d/*.conf
/etc/sysctl.conf

X-Gentoo-Bug: 484796
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=484796
This commit is contained in:
William Hubbs 2014-08-06 22:01:30 -05:00
parent 6a337ff6c5
commit d29db70efb

View File

@ -10,25 +10,7 @@ depend()
start()
{
local conf= retval=0 err errs
ebegin "Configuring kernel parameters"
eindent
for conf in @SYSCONFDIR@/sysctl.conf @SYSCONFDIR@/sysctl.d/*.conf; do
if [ -r "$conf" ]; then
vebegin "applying $conf"
if ! err=$(sysctl -p "$conf" 2>&1 >/dev/null) ; then
errs="${errs} ${err}"
sysctl -e -p "${conf}" >/dev/null
fi
veend $? || retval=1
fi
done
eoutdent
if [ ${retval} -eq 0 ] && [ -n "${errs}" ] ; then
ewarn "Unknown keys:${errs}"
fi
eend $retval "Some errors were encountered: ${errs}"
sysctl --system
eend $? "Unable to configure some kernel parameters"
}