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 | |
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.
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | initscripts.spec | 2 | ||||
-rw-r--r-- | rc.d/init.d/functions | 25 |
3 files changed, 25 insertions, 9 deletions
@@ -33,11 +33,12 @@ install: install -m755 sys-unconfig $(ROOT)/usr/sbin install -m644 crypttab.5 $(ROOT)$(mandir)/man5 install -m644 service.8 sys-unconfig.8 $(ROOT)$(mandir)/man8 - install -m644 sysctl.conf $(ROOT)/etc/sysctl.conf + mkdir -p -m 755 $(ROOT)/usr/lib/sysctl.d + install -m644 sysctl.conf $(ROOT)/usr/lib/sysctl.d/00-system.conf if uname -m | grep -q sparc ; then \ - install -m644 sysctl.conf.sparc $(ROOT)/etc/sysctl.conf ; fi + install -m644 sysctl.conf.sparc $(ROOT)/usr/lib/sysctl.d/00-system.conf ; fi if uname -m | grep -q s390 ; then \ - install -m644 sysctl.conf.s390 $(ROOT)/etc/sysctl.conf ; fi + install -m644 sysctl.conf.s390 $(ROOT)/usr/lib/sysctl.d/00-system.conf ; fi mkdir -p $(ROOT)/etc/X11 install -m755 prefdm $(ROOT)/etc/X11/prefdm diff --git a/initscripts.spec b/initscripts.spec index deff3640..72c3d180 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -258,7 +258,7 @@ rm -rf $RPM_BUILD_ROOT %exclude /etc/rc.d/init.d/reboot %exclude /etc/rc.d/init.d/single %ghost %verify(not md5 size mtime) %config(noreplace,missingok) /etc/rc.d/rc.local -%config(noreplace) /etc/sysctl.conf +/usr/lib/sysctl.d/00-system.conf %exclude /etc/profile.d/debug* /etc/profile.d/* /usr/sbin/sys-unconfig 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() { |