summary refs log tree commit diff
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2019-12-28 02:41:23 +0100
committerGitHub <noreply@github.com>2019-12-28 02:41:23 +0100
commitb4e19f6e87fad71aa83c1b610b3dd44befa71c85 (patch)
tree684cdfc8f00d560467dd045663e6409dcbc3d461
parent7082410e3381937f5b42a609884666c44a63d269 (diff)
parent9c2358e4865327b76ee9273448e2cd78a18d76f3 (diff)
downloadrunit-void-b4e19f6e87fad71aa83c1b610b3dd44befa71c85.tar.gz
runit-void-b4e19f6e87fad71aa83c1b610b3dd44befa71c85.tar.xz
runit-void-b4e19f6e87fad71aa83c1b610b3dd44befa71c85.zip
Merge pull request #31 from CameronNemo/sysctloct
fix(sysctl): behave more like sysctl --system
-rw-r--r--core-services/08-sysctl.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/core-services/08-sysctl.sh b/core-services/08-sysctl.sh
index 37d7b9f..3df5c5a 100644
--- a/core-services/08-sysctl.sh
+++ b/core-services/08-sysctl.sh
@@ -2,15 +2,19 @@
 
 if [ -x /sbin/sysctl -o -x /bin/sysctl ]; then
     msg "Loading sysctl(8) settings..."
+    mkdir -p /run/vsysctl.d
     for i in /run/sysctl.d/*.conf \
         /etc/sysctl.d/*.conf \
         /usr/local/lib/sysctl.d/*.conf \
-        /usr/lib/sysctl.d/*.conf \
-        /etc/sysctl.conf; do
+        /usr/lib/sysctl.d/*.conf; do
 
-        if [ -e "$i" ]; then
-            printf '* Applying %s ...\n' "$i"
-            sysctl -p "$i"
+        if [ -e "$i" ] && [ ! -e "/run/vsysctl.d/${i##*/}" ]; then
+            ln -s "$i" "/run/vsysctl.d/${i##*/}"
         fi
     done
+    for i in /run/vsysctl.d/*.conf; do
+        sysctl -p "$i"
+    done
+    rm -rf -- /run/vsysctl.d
+    sysctl -p /etc/sysctl.conf
 fi