1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#!/bin/sh
set -e
_update_sysctl() {
# Conditionally apply the updated sysctl configuration:
# - The init system must not be systemd; if it is then its own
# file trigger will handle this.
# - /proc/sys must be available.
# - We must not be running in a chroot, as we would then wrongly
# override the outer system.
# - We must not be running in a container, as many sysctls will
# not be writable and we don't know how to handle that.
if ! [ -d /run/systemd/system ] \
&& [ -d /proc/sys ] \
&& ! ischroot \
&& ! grep -qz '^container=' /proc/1/environ; then
echo 'procps: Applying updated sysctl configuration'
sysctl -q --system || true
fi
}
if [ "$1" = "triggered" ]; then
shift
for trigger in "$@"; do
case "$trigger" in
/usr/lib/sysctl.d)
_update_sysctl
;;
esac
done
exit 0
fi
#DEBHELPER#
|