mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-09 18:49:22 +00:00
fix(scripts): fixed driver names for new falcoctl/Falco naming.
But keep old systemd units names to avoid a breaking change. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
committed by
poiana
parent
27161bb508
commit
33451cf0bc
@@ -18,6 +18,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
chosen_driver=
|
chosen_driver=
|
||||||
|
chosen_unit=
|
||||||
|
|
||||||
# Every time we call this script we want to stat from a clean state.
|
# Every time we call this script we want to stat from a clean state.
|
||||||
echo "[POST-INSTALL] Disable all possible 'falco' services:"
|
echo "[POST-INSTALL] Disable all possible 'falco' services:"
|
||||||
@@ -47,12 +48,15 @@ if [ "$1" = "configure" ]; then
|
|||||||
case $CHOICE in
|
case $CHOICE in
|
||||||
2)
|
2)
|
||||||
chosen_driver="kmod"
|
chosen_driver="kmod"
|
||||||
|
chosen_unit="kmod"
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
chosen_driver="bpf"
|
chosen_driver="ebpf"
|
||||||
|
chosen_unit="bpf"
|
||||||
;;
|
;;
|
||||||
4)
|
4)
|
||||||
chosen_driver="modern-bpf"
|
chosen_driver="modern_ebpf"
|
||||||
|
chosen_unit="modern-bpf"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ -n "$chosen_driver" ]; then
|
if [ -n "$chosen_driver" ]; then
|
||||||
@@ -104,18 +108,18 @@ case "$chosen_driver" in
|
|||||||
echo "[POST-INSTALL] Call 'falcoctl driver install for kmod:"
|
echo "[POST-INSTALL] Call 'falcoctl driver install for kmod:"
|
||||||
falcoctl driver install --download=false
|
falcoctl driver install --download=false
|
||||||
;;
|
;;
|
||||||
"bpf")
|
"ebpf")
|
||||||
echo "[POST-INSTALL] Call 'falcoctl driver install for bpf':"
|
echo "[POST-INSTALL] Call 'falcoctl driver install for ebpf':"
|
||||||
falcoctl driver install
|
falcoctl driver install
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
||||||
if [ -n "$chosen_driver" ]; then
|
if [ -n "$chosen_unit" ]; then
|
||||||
# we do this in 2 steps because `enable --now` is not always supported
|
# we do this in 2 steps because `enable --now` is not always supported
|
||||||
echo "[POST-INSTALL] Enable 'falco-$chosen_driver.service':"
|
echo "[POST-INSTALL] Enable 'falco-$chosen_unit.service':"
|
||||||
systemctl --system enable "falco-$chosen_driver.service" || true
|
systemctl --system enable "falco-$chosen_unit.service" || true
|
||||||
echo "[POST-INSTALL] Start 'falco-$chosen_driver.service':"
|
echo "[POST-INSTALL] Start 'falco-$chosen_unit.service':"
|
||||||
systemctl --system start "falco-$chosen_driver.service" || true
|
systemctl --system start "falco-$chosen_unit.service" || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
chosen_driver=
|
chosen_driver=
|
||||||
|
chosen_unit=
|
||||||
|
|
||||||
# Every time we call this script we want to stat from a clean state.
|
# Every time we call this script we want to stat from a clean state.
|
||||||
echo "[POST-INSTALL] Disable all possible enabled 'falco' service:"
|
echo "[POST-INSTALL] Disable all possible enabled 'falco' service:"
|
||||||
@@ -46,12 +47,15 @@ if [ $1 -ge 1 ]; then
|
|||||||
case $CHOICE in
|
case $CHOICE in
|
||||||
2)
|
2)
|
||||||
chosen_driver="kmod"
|
chosen_driver="kmod"
|
||||||
|
chosen_unit="kmod"
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
chosen_driver="bpf"
|
chosen_driver="ebpf"
|
||||||
|
chosen_unit="bpf"
|
||||||
;;
|
;;
|
||||||
4)
|
4)
|
||||||
chosen_driver="modern-bpf"
|
chosen_driver="modern_ebpf"
|
||||||
|
chosen_unit="modern-bpf"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ -n "$chosen_driver" ]; then
|
if [ -n "$chosen_driver" ]; then
|
||||||
@@ -103,8 +107,8 @@ case "$chosen_driver" in
|
|||||||
echo "[POST-INSTALL] Call 'falcoctl driver install for kmod:"
|
echo "[POST-INSTALL] Call 'falcoctl driver install for kmod:"
|
||||||
falcoctl driver install --download=false
|
falcoctl driver install --download=false
|
||||||
;;
|
;;
|
||||||
"bpf")
|
"ebpf")
|
||||||
echo "[POST-INSTALL] Call 'falcoctl driver install for bpf':"
|
echo "[POST-INSTALL] Call 'falcoctl driver install for ebpf':"
|
||||||
falcoctl driver install
|
falcoctl driver install
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -116,14 +120,14 @@ esac
|
|||||||
# systemd_post macro expands to
|
# systemd_post macro expands to
|
||||||
# if postinst:
|
# if postinst:
|
||||||
# `systemd-update-helper install-system-units <service>`
|
# `systemd-update-helper install-system-units <service>`
|
||||||
%systemd_post "falco-$chosen_driver.service"
|
%systemd_post "falco-$chosen_unit.service"
|
||||||
|
|
||||||
# post install/upgrade mirrored from .deb
|
# post install/upgrade mirrored from .deb
|
||||||
if [ $1 -ge 1 ]; then
|
if [ $1 -ge 1 ]; then
|
||||||
if [ -n "$chosen_driver" ]; then
|
if [ -n "$chosen_unit" ]; then
|
||||||
echo "[POST-INSTALL] Enable 'falco-$chosen_driver.service':"
|
echo "[POST-INSTALL] Enable 'falco-$chosen_unit.service':"
|
||||||
systemctl --system enable "falco-$chosen_driver.service" || true
|
systemctl --system enable "falco-$chosen_unit.service" || true
|
||||||
echo "[POST-INSTALL] Start 'falco-$chosen_driver.service':"
|
echo "[POST-INSTALL] Start 'falco-$chosen_unit.service':"
|
||||||
systemctl --system start "falco-$chosen_driver.service" || true
|
systemctl --system start "falco-$chosen_unit.service" || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user