base-files: evaluate /etc/sysctl.d/* before /etc/sysctl.conf
authorMatthias Schiffer <mschiffer@universe-factory.net>
Thu, 12 Apr 2018 15:33:51 +0000 (17:33 +0200)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Fri, 13 Apr 2018 08:16:45 +0000 (10:16 +0200)
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@universe-factory.net>
package/base-files/files/etc/hotplug.d/net/00-sysctl
package/base-files/files/etc/init.d/sysctl

index 7a71652..8abe7f8 100644 (file)
@@ -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
index 65e6aa9..8722126 100755 (executable)
@@ -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
 }