aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile7
-rw-r--r--initscripts.spec2
-rw-r--r--rc.d/init.d/functions25
3 files changed, 25 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 3d1ae951..688c510b 100644
--- a/Makefile
+++ b/Makefile
@@ -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() {