#!/bin/sh # prerm script for barman set -e case "$1" in remove|upgrade|deconfigure) # dh_installsystemd only manages the bare template, not its per-server # instances, so stop any running instance before the barman binary and # polkit rule go away (otherwise it is left orphaned holding its # replication slot, or crash-loops under Restart=). deb-systemd-invoke # honours policy-rc.d and is a no-op when systemd is not running. if command -v deb-systemd-invoke >/dev/null; then deb-systemd-invoke stop 'barman-receive-wal@*.service' >/dev/null 2>&1 || true fi ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0