summaryrefslogtreecommitdiffstats
path: root/debian/systemd-coredump.prerm
blob: 89cf954eb963361954ead29bec18ba5c017c7278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
set -e

if [ "$1" = remove ]; then
    # disable systemd-coredump on removal
    if [ -w /proc/sys/kernel/core_pattern ] && grep -q '^|.*systemd-coredump' /proc/sys/kernel/core_pattern; then
        echo core > /proc/sys/kernel/core_pattern
    fi
    if [ -d /run/systemd/system ]; then
        systemctl stop systemd-coredump.socket || true
    fi
fi

#DEBHELPER#