[openwrt/openwrt] base-files: evaluate /etc/sysctl.d/* before /etc/sysctl.conf

LEDE Commits lede-commits at lists.infradead.org
Fri Apr 13 01:21:51 PDT 2018


neoraider pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/dbeb780ba423fc5aae66f503cf91b24a31db6d71

commit dbeb780ba423fc5aae66f503cf91b24a31db6d71
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Thu Apr 12 17:33:51 2018 +0200

    base-files: evaluate /etc/sysctl.d/* before /etc/sysctl.conf
    
    We can use /etc/sysctl.d/* for package-supplied sysctl snippets, giving
    admins the option to use /etc/sysctl.conf to override settings.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/base-files/files/etc/hotplug.d/net/00-sysctl | 2 +-
 package/base-files/files/etc/init.d/sysctl           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/etc/hotplug.d/net/00-sysctl b/package/base-files/files/etc/hotplug.d/net/00-sysctl
index 7a71652..8abe7f8 100644
--- a/package/base-files/files/etc/hotplug.d/net/00-sysctl
+++ b/package/base-files/files/etc/hotplug.d/net/00-sysctl
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$ACTION" = add ]; then
-	for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
+	for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
 		[ ! -f "$CONF" ] && continue;
 		sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
 			sysctl -e -p - | logger -t sysctl
diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl
index 65e6aa9..8722126 100755
--- a/package/base-files/files/etc/init.d/sysctl
+++ b/package/base-files/files/etc/init.d/sysctl
@@ -30,7 +30,7 @@ apply_defaults() {
 
 start() {
 	apply_defaults
-	for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
+	for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
 		[ -f "$CONF" ] && sysctl -p "$CONF" -e >&-
 	done
 }



More information about the lede-commits mailing list