diff options
author | Bill Nottingham <notting@redhat.com> | 2012-04-20 15:01:24 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2012-04-20 15:01:24 -0400 |
commit | f4852e09cd32f33b0c496864171d8dc9e85bd0cf (patch) | |
tree | e12d9dcf8104367d264534cbf8ac9365b6026211 /rc.d | |
parent | fa2911a4dc5cc793f495b39d9c71bbcc29ff011b (diff) | |
download | initscripts-f4852e09cd32f33b0c496864171d8dc9e85bd0cf.tar initscripts-f4852e09cd32f33b0c496864171d8dc9e85bd0cf.tar.gz initscripts-f4852e09cd32f33b0c496864171d8dc9e85bd0cf.tar.bz2 initscripts-f4852e09cd32f33b0c496864171d8dc9e85bd0cf.tar.xz initscripts-f4852e09cd32f33b0c496864171d8dc9e85bd0cf.zip |
Move default sysctl.conf to /usr/lib/sysctl.d, adjust things accordingly. (#760254)
Also, update apply_sysctl to 1) use systemd-sysctl if it's there 2) imitate it if it's not.
Diffstat (limited to 'rc.d')
-rw-r--r-- | rc.d/init.d/functions | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 7754ff21..e9892b42 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -660,11 +660,26 @@ is_false() { # Apply sysctl settings, including files in /etc/sysctl.d apply_sysctl() { - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 - for file in /etc/sysctl.d/* ; do - is_ignored_file "$file" && continue - test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 - done + if [ -x /lib/systemd/systemd-sysctl ]; then + /lib/systemd/systemd-sysctl + else + for file in /usr/lib/sysctl.d/*.conf ; do + is_ignored_file "$file" && continue + [ -f /run/sysctl.d/${file##*/} ] && continue + [ -f /etc/sysctl.d/${file##*/} ] && continue + test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 + done + for file in /run/sysctl.d/*.conf ; do + is_ignored_file "$file" && continue + [ -f /etc/sysctl.d/${file##*/} ] && continue + test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 + done + for file in /etc/sysctl.d/*.conf ; do + is_ignored_file "$file" && continue + test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 + done + sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + fi } key_is_random() { |