diff options
author | Roy Marples <roy@marples.name> | 2009-11-10 22:40:35 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2009-11-10 22:40:35 +0000 |
commit | 1d9ce8e9a1ece0fd108b2b50b45bc4a0da0cf3fc (patch) | |
tree | e53a60d25998b239c44c73513027d43e59f2ddcd | |
parent | bb96dc4e01db2ba47c4be98dfe0f5e208df9ec2e (diff) |
Allow sysctl to read confs from /etc/sysctl.d
Fixes #203.
-rw-r--r-- | init.d/sysctl.BSD.in | 22 | ||||
-rw-r--r-- | init.d/sysctl.Linux.in | 14 |
2 files changed, 26 insertions, 10 deletions
diff --git a/init.d/sysctl.BSD.in b/init.d/sysctl.BSD.in index 22b364b2..eba9d4d6 100644 --- a/init.d/sysctl.BSD.in +++ b/init.d/sysctl.BSD.in @@ -12,13 +12,21 @@ depend() start() { [ -e /etc/sysctl.conf ] || return 0 - local retval=0 var= comments= + local retval=0 var= comments= conf= ebegin "Configuring kernel parameters" - while read var comments; do - case "$var" in - ""|"#"*) continue;; - esac - sysctl -w "$var" >/dev/null || retval=1 - done < /etc/sysctl.conf + eindent + for conf in /etc/sysctl.d/*.conf /etc/sysctl.conf; do + if [ -r "$conf" ]; then + vebegin "applying $conf" + while read var comments; do + case "$var" in + ""|"#"*) continue;; + esac + sysctl -w "$var" >/dev/null || retval=1 + done < "$conf" + veend $retval + fi + done + eoutdent eend $retval "Some errors were encountered" } diff --git a/init.d/sysctl.Linux.in b/init.d/sysctl.Linux.in index 39ce01d6..19c22b4a 100644 --- a/init.d/sysctl.Linux.in +++ b/init.d/sysctl.Linux.in @@ -11,8 +11,16 @@ depend() start() { - [ -e /etc/sysctl.conf ] || return 0 + local conf= retval=0 ebegin "Configuring kernel parameters" - sysctl -p >/dev/null - eend $? "Some errors were encountered" + eindent + for conf in /etc/sysctl.d/*.conf /etc/sysctl.conf; do + if [ -r "$conf" ]; then + vebegin "applying $conf" + sysctl -p "$conf" >/dev/null + veend $? || retval=1 + fi + done + eoutdent + eend $retval "Some errors were encountered" } |