36 lines
1.5 KiB
Diff
36 lines
1.5 KiB
Diff
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
|
Date: Thu, 12 Apr 2018 17:33:51 +0200
|
|
Subject: 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@universe-factory.net>
|
|
|
|
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 7a71652c44f8bd1fb9f2e5643e7baa5d5d76c369..8abe7f8bbd698dc58716b770fe8bc7f8bd475b58 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 65e6aa99250d09a3ccd9d023cb8f8205be86eee8..8722126a6612d67a3f615166a7fbec146207e97f 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
|
|
}
|