about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJuan RP <xtraeme@voidlinux.eu>2015-09-05 16:48:41 +0200
committerJuan RP <xtraeme@voidlinux.eu>2015-09-05 16:48:41 +0200
commit5f719f131c3d75a99f1a09d4cd7ccccc1534a100 (patch)
treeb12872513e75cf79cbb7ea23c3dbf374ec03207c
parentef157a51d9e15c70a7294193319e6073758a09df (diff)
downloadrunit-void-5f719f131c3d75a99f1a09d4cd7ccccc1534a100.tar.gz
runit-void-5f719f131c3d75a99f1a09d4cd7ccccc1534a100.tar.xz
runit-void-5f719f131c3d75a99f1a09d4cd7ccccc1534a100.zip
core-services/sysctl: drop sysctl(8) --system requirement. 20150905
Use sysctl -p everywhere: works with procps-ng and busybox (and probably
others as well).
-rw-r--r--README.md2
-rw-r--r--core-services/08-sysctl.sh28
2 files changed, 12 insertions, 18 deletions
diff --git a/README.md b/README.md
index e6f2f1c..484fecb 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ difference that I'm trying to avoid the bash dependency.
 
 - A POSIX shell
 - A POSIX awk
-- procps-ng (needs pkill -s0,1 and sysctl --system)
+- procps-ng (needs pkill -s0,1)
 - runit
 
 ### How to use it
diff --git a/core-services/08-sysctl.sh b/core-services/08-sysctl.sh
index 10aa73a..37d7b9f 100644
--- a/core-services/08-sysctl.sh
+++ b/core-services/08-sysctl.sh
@@ -1,22 +1,16 @@
 # vim: set ts=4 sw=4 et:
 
 if [ -x /sbin/sysctl -o -x /bin/sysctl ]; then
-    msg "Loading sysctl(8) settings...\n"
+    msg "Loading sysctl(8) settings..."
+    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
 
-    if sysctl -V >/dev/null 2>&1; then
-        sysctl --system
-    else
-        # Fallback for busybox sysctl
-        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
-
-            if [ -e "$i" ]; then
-                printf '* Applying %s ...\n' "$i"
-                sysctl -p "$i"
-            fi
-        done
-    fi
+        if [ -e "$i" ]; then
+            printf '* Applying %s ...\n' "$i"
+            sysctl -p "$i"
+        fi
+    done
 fi