base-files: also read sysctl from /tmp/run/sysctl.d

There are situations where the change of a sysctl parameter should not
be saved persistently. Therefore, this change adds the possibility that
sysctl parameters can also be loaded from '/tmp/run/sysctl.d/*.conf'.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2024-05-17 09:19:05 +02:00
parent 8742deeff9
commit 5446a1b179

View File

@ -39,7 +39,7 @@ apply_defaults() {
start() {
apply_defaults
[ -f /tmp/sysctl-default.conf ] || sysctl -a 1>/tmp/sysctl-default.conf 2>/dev/null
for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf /tmp/run/sysctl.d/*.conf; do
[ -f "$CONF" ] && sysctl -e -p "$CONF" >&-
done
}