[projects/rc-scripts] Set sysctl setting using syctl --system option.

arekm arekm at pld-linux.org
Sun Apr 25 19:56:57 CEST 2021


commit 3f911248f56245da6bd8b3e54a694bb189acd036
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Apr 25 19:56:49 2021 +0200

    Set sysctl setting using syctl --system option.

 lib/functions | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/lib/functions b/lib/functions
index b696738f..3b97077b 100644
--- a/lib/functions
+++ b/lib/functions
@@ -180,20 +180,7 @@ apply_sysctl() {
 		return
 	fi
 
-	local file
-	for file in /usr/lib/sysctl.d/*.conf; do
-		[ -f "/run/sysctl.d/${file##*/}" ] && continue
-		[ -f "/etc/sysctl.d/${file##*/}" ] && continue
-		test -f "$file" && sysctl -q -e -p "$file"
-	done
-	for file in /run/sysctl.d/*.conf; do
-		[ -f "/etc/sysctl.d/${file##*/}" ] && continue
-		test -f "$file" && sysctl -q -e -p "$file"
-	done
-	for file in /etc/sysctl.d/*.conf; do
-		test -f "$file" && sysctl -q -e -p "$file"
-	done
-	sysctl -q -e -p /etc/sysctl.conf
+	sysctl -q -e --system
 }
 
 if is_yes "$FASTRC" || is_yes "$IN_SHUTDOWN"; then
@@ -201,8 +188,8 @@ if is_yes "$FASTRC" || is_yes "$IN_SHUTDOWN"; then
 fi
 
 if is_no "$RC_LOGGING"; then
-	initlog() {
-		RESULT=0
+		initlog() {
+			RESULT=0
 		while [ "$1" != "${1##-}" ]; do
 			case $1 in
 			-c)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/3f911248f56245da6bd8b3e54a694bb189acd036



More information about the pld-cvs-commit mailing list