fix: stop also falco-kmod-inject.service unit

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
This commit is contained in:
Andrea Terzolo 2022-11-11 14:15:48 +00:00 committed by poiana
parent ee08c4d3de
commit 5bb566d613
4 changed files with 9 additions and 6 deletions

View File

@ -22,16 +22,18 @@ set -e
# Currently running falco service uses the driver, so stop it before driver cleanup
if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
echo "[POST-REMOVE] Stop all Falco services:"
echo "[PRE-REMOVE] Stop all Falco services:"
systemctl --system stop 'falco-kmod.service' || true
systemctl --system stop 'falco-bpf.service' || true
systemctl --system stop 'falco-modern-bpf.service' || true
systemctl --system stop 'falco-plugin.service' || true
# this should be stopped after 'falco-kmod.service'
systemctl --system stop 'falco-kmod-inject.service' || true
fi
case "$1" in
remove|upgrade|deconfigure)
echo "[POST-REMOVE] Call 'falco-driver-loader --clean:'"
echo "[PRE-REMOVE] Call 'falco-driver-loader --clean:'"
falco-driver-loader --clean
;;
esac

View File

@ -19,14 +19,16 @@ set -e
# pre uninstall mirrored from .deb
# Currently running falco service uses the driver, so stop it before driver cleanup
if [ -d /run/systemd/system ] && [ $1 -eq 0 ]; then
echo "[POST-REMOVE] Stop all Falco services:"
echo "[PRE-REMOVE] Stop all Falco services:"
systemctl --system stop 'falco-kmod.service' || true
systemctl --system stop 'falco-bpf.service' || true
systemctl --system stop 'falco-modern-bpf.service' || true
systemctl --system stop 'falco-plugin.service' || true
# this should be stopped after 'falco-kmod.service'
systemctl --system stop 'falco-kmod-inject.service' || true
fi
echo "[POST-REMOVE] Call 'falco-driver-loader --clean:'"
echo "[PRE-REMOVE] Call 'falco-driver-loader --clean:'"
falco-driver-loader --clean
# validate rpm macros by `rpm -qp --scripts <rpm>`

View File

@ -4,7 +4,5 @@ Documentation=https://falco.org/docs/
[Service]
Type=oneshot
RemainAfterExit=yes
User=root
ExecStart=/sbin/modprobe falco
ExecStop=/sbin/rmmod falco

View File

@ -11,6 +11,7 @@ Conflicts=falco-plugin.service
Type=simple
User=root
ExecStart=/usr/bin/falco --pidfile=/var/run/falco.pid
ExecStopPost=/sbin/rmmod falco
UMask=0077
TimeoutSec=30
RestartSec=15s