File: procps.postinst

package info (click to toggle)
procps 2%3A4.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 14,424 kB
  • sloc: ansic: 32,770; sh: 5,995; exp: 775; makefile: 691; sed: 16
file content (35 lines) | stat: -rw-r--r-- 948 bytes parent folder | download | duplicates (2)
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#