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>
This commit is contained in:
Matthias Schiffer 2018-04-12 17:33:51 +02:00
parent 6c7307f133
commit dbeb780ba4
No known key found for this signature in database
GPG key ID: 16EF3F64CB201D9C
2 changed files with 2 additions and 2 deletions

View 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

View file

@ -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
}