aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/0001-sysctl.Linux.in-fix-for-busybox-sysctl.patch
blob: 0814876a3a8ceb15f330e98f5273097327c88552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From cc347f6ddacb3c4f1bfc87b274fef1fd7924a539 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 28 Apr 2015 12:26:46 +0200
Subject: [PATCH] sysctl.Linux.in: fix for busybox sysctl

busybox sysctl does not support --system
---
 init.d/sysctl.Linux.in | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/init.d/sysctl.Linux.in b/init.d/sysctl.Linux.in
index 186c6ed..ff17892 100644
--- a/init.d/sysctl.Linux.in
+++ b/init.d/sysctl.Linux.in
@@ -10,10 +10,21 @@ depend()
 
 start()
 {
-	local quiet
+	local quiet rc=0
 	yesno $rc_verbose || quiet=-q
 
 	ebegin "Configuring kernel parameters"
-	sysctl ${quiet} --system
-	eend $? "Unable to configure some kernel parameters"
+	set --
+	for i in /run/sysctl.d/*.conf \
+			/etc/sysctl.d/*.conf \
+			/usr/local/lib/sysctl.d/*.conf \
+			/usr/lib/sysctl.d/*.conf \
+			/lib/sysctl.d/*.conf \
+			/etc/sysctl.conf; do
+		if [ -e "$i" ]; then
+			sysctl ${quiet} -p "$i"
+			rc=$(( $rc + $? ))
+		fi
+	done
+	eend $rc "Unable to configure some kernel parameters"
 }
-- 
2.4.5