init.d/sysctl.Linux: do not use sysctl -q

The -q option is not implemented by BusyBox, so instead of using that, make
it so that the standard error is caught, but standard output is thrown
away.

Note: the ordered behaviour of redirection is part of POSIX so we should be
on the safe side with this change, as first we duplicate the output
descriptor to be used as stderr, then we change the output descriptor to
point to NULL.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
This commit is contained in:
Diego Elio Pettenò 2012-03-24 00:01:29 +01:00 committed by William Hubbs
parent eb11953dd2
commit 8104618d10

View File

@ -18,9 +18,9 @@ start()
for conf in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
if [ -r "$conf" ]; then
vebegin "applying $conf"
if ! err=$(sysctl -q -p "$conf" 2>&1) ; then
if ! err=$(sysctl -p "$conf" 2>&1 >/dev/null) ; then
errs="${errs} ${err}"
sysctl -q -e -p "${conf}"
sysctl -e -p "${conf}" >/dev/null
fi
veend $? || retval=1
fi