about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEivind Uggedal <eivind@uggedal.com>2015-08-27 14:37:46 +0200
committerEivind Uggedal <eivind@uggedal.com>2015-08-27 14:37:46 +0200
commitef157a51d9e15c70a7294193319e6073758a09df (patch)
tree700306816bb26d4f72610b44e3c5cc40b41b52b5
parent95e7eb7afe216b576c627aec8010c34b27555e13 (diff)
parent9fa18b2033e59b0e9422f85c496c5eedefb4602a (diff)
downloadrunit-void-ef157a51d9e15c70a7294193319e6073758a09df.tar.gz
runit-void-ef157a51d9e15c70a7294193319e6073758a09df.tar.xz
runit-void-ef157a51d9e15c70a7294193319e6073758a09df.zip
Merge pull request #40 from voidlinux/busybox-sysctl 20150827
core-services: sysctl --system fallback for busybox
-rw-r--r--core-services/08-sysctl.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/core-services/08-sysctl.sh b/core-services/08-sysctl.sh
index 44aa4ad..10aa73a 100644
--- a/core-services/08-sysctl.sh
+++ b/core-services/08-sysctl.sh
@@ -1,6 +1,22 @@
 # vim: set ts=4 sw=4 et:
 
 if [ -x /sbin/sysctl -o -x /bin/sysctl ]; then
-    msg "Loading sysctl(8) settings..."
-    sysctl --system
+    msg "Loading sysctl(8) settings...\n"
+
+    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
 fi