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 7a71652c44f8bd1fb9f2e5643e7baa5d5d76c369..8abe7f8bbd698dc58716b770fe8bc7f8bd475b58 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 65e6aa99250d09a3ccd9d023cb8f8205be86eee8..8722126a6612d67a3f615166a7fbec146207e97f 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
 }