aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/0003-sysctl.Linux.in-fix-for-busybox-sysctl.patch
blob: 22f1a626d8cbe73cc434f92b447e3a21c4c27891 (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 67cea9c310c90198f7f788d6ac1a90b8ed57183c Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 17 Aug 2016 17:14:37 +0200
Subject: [PATCH 3/7] 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 f5e0ab6..e1a1932 100644
--- a/init.d/sysctl.Linux.in
+++ b/init.d/sysctl.Linux.in
@@ -17,10 +17,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.9.3