cleanup(scripts): cleanup systemd unit in DEB installer

Signed-off-by: Stanley Chan <pocketgamer5000@gmail.com>
This commit is contained in:
Stanley Chan
2022-07-20 11:47:57 -05:00
committed by poiana
parent 3c02b40a21
commit 7610ee53e5
3 changed files with 61 additions and 0 deletions

View File

@@ -17,6 +17,14 @@
#
set -e
# Based off what debhelper dh_systemd_enable/13.3.4 would have added
# ref: https://www.debian.org/doc/manuals/debmake-doc/ch05.en.html#debhelper
# Currently running falco service uses the driver, so stop it before driver cleanup
if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
deb-systemd-invoke stop 'falco.service' >/dev/null || true
fi
case "$1" in
remove|upgrade|deconfigure)
/usr/bin/falco-driver-loader --clean