mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-30 00:22:15 +00:00
update(scripts): multiple renamings to falcoctl service + fixed description.
Moreover, now falcoctl service is enabled by default. It being bound to falco.target allows us to avoid it running when falco.target is not running. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
parent
2591ed4d68
commit
0f22fde7cd
@ -6,7 +6,7 @@ if(CPACK_GENERATOR MATCHES "DEB" OR CPACK_GENERATOR MATCHES "RPM")
|
|||||||
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-bpf.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
|
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-bpf.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
|
||||||
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-modern-bpf.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
|
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-modern-bpf.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
|
||||||
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-plugin.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
|
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-plugin.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
|
||||||
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falcoctl.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
|
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falcoctl-artifact-follow.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CPACK_GENERATOR MATCHES "TGZ")
|
if(CPACK_GENERATOR MATCHES "TGZ")
|
||||||
|
@ -28,7 +28,7 @@ file(COPY "${PROJECT_SOURCE_DIR}/scripts/systemd/falco-modern-bpf.service"
|
|||||||
DESTINATION "${PROJECT_BINARY_DIR}/scripts/systemd")
|
DESTINATION "${PROJECT_BINARY_DIR}/scripts/systemd")
|
||||||
file(COPY "${PROJECT_SOURCE_DIR}/scripts/systemd/falco-plugin.service"
|
file(COPY "${PROJECT_SOURCE_DIR}/scripts/systemd/falco-plugin.service"
|
||||||
DESTINATION "${PROJECT_BINARY_DIR}/scripts/systemd")
|
DESTINATION "${PROJECT_BINARY_DIR}/scripts/systemd")
|
||||||
file(COPY "${PROJECT_SOURCE_DIR}/scripts/systemd/falcoctl.service"
|
file(COPY "${PROJECT_SOURCE_DIR}/scripts/systemd/falcoctl-artifact-follow.service"
|
||||||
DESTINATION "${PROJECT_BINARY_DIR}/scripts/systemd")
|
DESTINATION "${PROJECT_BINARY_DIR}/scripts/systemd")
|
||||||
|
|
||||||
# Debian
|
# Debian
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
chosen_driver=
|
chosen_driver=
|
||||||
enable_falcoctl=0
|
enable_falcoctl=1
|
||||||
|
|
||||||
if [ "$1" = "configure" ]; then
|
if [ "$1" = "configure" ]; then
|
||||||
if [ -x /usr/bin/dialog ]; then
|
if [ -x /usr/bin/dialog ]; then
|
||||||
@ -40,21 +40,18 @@ if [ "$1" = "configure" ]; then
|
|||||||
chosen_driver="modern-bpf"
|
chosen_driver="modern-bpf"
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
chosen_driver="plugin"
|
chosen_driver="plugin (needs manual configuration)"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
CHOICE=$(dialog --clear --title "Falcoctl" --menu "Do you want to follow automatic ruleset updates?" 10 40 2 \
|
||||||
if [ -n "$chosen_driver" ]; then
|
1 "Yes" \
|
||||||
CHOICE=$(dialog --clear --title "Falcoctl" --menu "Do you want to subscribe to automatic ruleset feed?" 10 40 2 \
|
2 "No" \
|
||||||
1 "No" \
|
2>&1 >/dev/tty)
|
||||||
2 "Yes" \
|
case $CHOICE in
|
||||||
2>&1 >/dev/tty)
|
2)
|
||||||
case $CHOICE in
|
enable_falcoctl=0
|
||||||
2)
|
;;
|
||||||
enable_falcoctl=1
|
esac
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
clear
|
clear
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -79,13 +76,12 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-decon
|
|||||||
systemctl --system enable "falco-$chosen_driver.service" || true
|
systemctl --system enable "falco-$chosen_driver.service" || true
|
||||||
echo "[POST-INSTALL] Start 'falco-$chosen_driver.service':"
|
echo "[POST-INSTALL] Start 'falco-$chosen_driver.service':"
|
||||||
systemctl --system start "falco-$chosen_driver.service" || true
|
systemctl --system start "falco-$chosen_driver.service" || true
|
||||||
|
fi
|
||||||
if [ $enable_falcoctl -eq 1 ]; then
|
if [ $enable_falcoctl -eq 1 ]; then
|
||||||
echo "[POST-INSTALL] Enable 'falcoctl.service':"
|
echo "[POST-INSTALL] Enable 'falcoctl-artifact-follow.service':"
|
||||||
systemctl --system enable "falcoctl.service" || true
|
systemctl --system enable "falcoctl-artifact-follow.service" || true
|
||||||
echo "[POST-INSTALL] Start 'falcoctl.service':"
|
echo "[POST-INSTALL] Start 'falcoctl-artifact-follow.service':"
|
||||||
systemctl --system start "falcoctl.service" || true
|
systemctl --system start "falcoctl-artifact-follow.service" || true
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -97,12 +93,11 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-decon
|
|||||||
echo "[POST-INSTALL] Trigger 'falco-$chosen_driver.service' condrestart:"
|
echo "[POST-INSTALL] Trigger 'falco-$chosen_driver.service' condrestart:"
|
||||||
# restart falco on upgrade if service is already running
|
# restart falco on upgrade if service is already running
|
||||||
systemctl --system condrestart "falco-$chosen_driver.service" || true
|
systemctl --system condrestart "falco-$chosen_driver.service" || true
|
||||||
|
fi
|
||||||
if [ $enable_falcoctl -eq 1 ]; then
|
if [ $enable_falcoctl -eq 1 ]; then
|
||||||
echo "[POST-INSTALL] Trigger 'falcoctl.service' condrestart:"
|
echo "[POST-INSTALL] Trigger 'falcoctl-artifact-follow.service' condrestart:"
|
||||||
# restart falcoctl on upgrade if service is already running
|
# restart falcoctl-artifact-follow on upgrade if service is already running
|
||||||
systemctl --system condrestart "falcoctl.service" || true
|
systemctl --system condrestart "falcoctl-artifact-follow.service" || true
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -27,7 +27,7 @@ if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
|
|||||||
systemctl --system disable 'falco-bpf.service' || true
|
systemctl --system disable 'falco-bpf.service' || true
|
||||||
systemctl --system disable 'falco-modern-bpf.service' || true
|
systemctl --system disable 'falco-modern-bpf.service' || true
|
||||||
systemctl --system disable 'falco-plugin.service' || true
|
systemctl --system disable 'falco-plugin.service' || true
|
||||||
systemctl --system disable 'falcoctl.service' || true
|
systemctl --system disable 'falcoctl-artifact-follow.service' || true
|
||||||
|
|
||||||
echo "[POST-REMOVE] Trigger deamon-reload:"
|
echo "[POST-REMOVE] Trigger deamon-reload:"
|
||||||
systemctl --system daemon-reload || true
|
systemctl --system daemon-reload || true
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
chosen_driver=
|
chosen_driver=
|
||||||
enable_falcoctl=0
|
enable_falcoctl=1
|
||||||
|
|
||||||
if [ $1 -eq 1 ]; then
|
if [ $1 -eq 1 ]; then
|
||||||
if [ -x /usr/bin/dialog ]; then
|
if [ -x /usr/bin/dialog ]; then
|
||||||
@ -39,20 +39,18 @@ if [ $1 -eq 1 ]; then
|
|||||||
chosen_driver="modern-bpf"
|
chosen_driver="modern-bpf"
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
chosen_driver="plugin"
|
chosen_driver="plugin (needs manual configuration)"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ -n "$chosen_driver" ]; then
|
CHOICE=$(dialog --clear --title "Falcoctl" --menu "Do you want to follow automatic ruleset updates?" 10 40 2 \
|
||||||
CHOICE=$(dialog --clear --title "Falcoctl" --menu "Do you want to subscribe to automatic ruleset feed?" 10 40 2 \
|
1 "Yes" \
|
||||||
1 "No" \
|
2 "No" \
|
||||||
2 "Yes" \
|
2>&1 >/dev/tty)
|
||||||
2>&1 >/dev/tty)
|
case $CHOICE in
|
||||||
case $CHOICE in
|
2)
|
||||||
2)
|
enable_falcoctl=0
|
||||||
enable_falcoctl=1
|
;;
|
||||||
;;
|
esac
|
||||||
esac
|
|
||||||
fi
|
|
||||||
clear
|
clear
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -87,13 +85,12 @@ if [ $1 -eq 1 ]; then
|
|||||||
systemctl --system enable "falco-$chosen_driver.service" || true
|
systemctl --system enable "falco-$chosen_driver.service" || true
|
||||||
echo "[POST-INSTALL] Start 'falco-$chosen_driver.service':"
|
echo "[POST-INSTALL] Start 'falco-$chosen_driver.service':"
|
||||||
systemctl --system start "falco-$chosen_driver.service" || true
|
systemctl --system start "falco-$chosen_driver.service" || true
|
||||||
|
fi
|
||||||
if [ $enable_falcoctl -eq 1 ]; then
|
if [ $enable_falcoctl -eq 1 ]; then
|
||||||
echo "[POST-INSTALL] Enable 'falcoctl.service':"
|
echo "[POST-INSTALL] Enable 'falcoctl-artifact-follow.service':"
|
||||||
systemctl --system enable "falcoctl.service" || true
|
systemctl --system enable "falcoctl-artifact-follow.service" || true
|
||||||
echo "[POST-INSTALL] Start 'falcoctl.service':"
|
echo "[POST-INSTALL] Start 'falcoctl-artifact-follow.service':"
|
||||||
systemctl --system start "falcoctl.service" || true
|
systemctl --system start "falcoctl-artifact-follow.service" || true
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -106,11 +103,11 @@ if [ $1 -gt 1 ]; then
|
|||||||
echo "[POST-INSTALL] Trigger 'falco-$chosen_driver.service' condrestart:"
|
echo "[POST-INSTALL] Trigger 'falco-$chosen_driver.service' condrestart:"
|
||||||
# restart falco on upgrade if service is already running
|
# restart falco on upgrade if service is already running
|
||||||
systemctl --system condrestart "falco-$chosen_driver.service" || true
|
systemctl --system condrestart "falco-$chosen_driver.service" || true
|
||||||
if [ $enable_falcoctl -eq 1 ]; then
|
fi
|
||||||
echo "[POST-INSTALL] Trigger 'falcoctl.service' condrestart:"
|
if [ $enable_falcoctl -eq 1 ]; then
|
||||||
# restart falcoctl on upgrade if service is already running
|
echo "[POST-INSTALL] Trigger 'falcoctl-artifact-follow.service' condrestart:"
|
||||||
systemctl --system condrestart "falcoctl.service" || true
|
# restart falcoctl-artifact-follow on upgrade if service is already running
|
||||||
fi
|
systemctl --system condrestart "falcoctl-artifact-follow.service" || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -23,7 +23,7 @@ if [ -d /run/systemd/system ] && [ $1 -eq 0 ]; then
|
|||||||
systemctl --system disable 'falco-bpf.service' || true
|
systemctl --system disable 'falco-bpf.service' || true
|
||||||
systemctl --system disable 'falco-modern-bpf.service' || true
|
systemctl --system disable 'falco-modern-bpf.service' || true
|
||||||
systemctl --system disable 'falco-plugin.service' || true
|
systemctl --system disable 'falco-plugin.service' || true
|
||||||
systemctl --system disable 'falcoctl.service' || true
|
systemctl --system disable 'falcoctl-artifact-follow.service' || true
|
||||||
|
|
||||||
echo "[POST-REMOVE] Trigger deamon-reload:"
|
echo "[POST-REMOVE] Trigger deamon-reload:"
|
||||||
systemctl --system daemon-reload || true
|
systemctl --system daemon-reload || true
|
||||||
|
@ -34,4 +34,4 @@ falco-driver-loader --clean
|
|||||||
%systemd_preun 'falco-bpf.service'
|
%systemd_preun 'falco-bpf.service'
|
||||||
%systemd_preun 'falco-modern-bpf.service'
|
%systemd_preun 'falco-modern-bpf.service'
|
||||||
%systemd_preun 'falco-plugin.service'
|
%systemd_preun 'falco-plugin.service'
|
||||||
%systemd_preun 'falcoctl.service'
|
%systemd_preun 'falcoctl-artifact-follow.service'
|
@ -1,5 +1,5 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Falco: Automatic rules update service
|
Description=Falcoctl Artifact Follow: automatic artifacts update service
|
||||||
Documentation=https://falco.org/docs/
|
Documentation=https://falco.org/docs/
|
||||||
After=falco.target
|
After=falco.target
|
||||||
BindsTo=falco.target
|
BindsTo=falco.target
|
Loading…
Reference in New Issue
Block a user