keepalived: add startup and shutdown script handling
authorFlorian Eckert <redacted>
Fri, 20 Oct 2023 08:59:53 +0000 (10:59 +0200)
committerFlorian Eckert <redacted>
Mon, 30 Oct 2023 13:09:36 +0000 (14:09 +0100)
The keepalived does support script call handling on start and stop.

All scripts located under '/etc/hotplug.d/keepalived' gets now called
with the env ACTION set to startup or shutdown. The script that want to
get called on this keepalived events could evalutate this env to run on
startup or shutdown.

Signed-off-by: Florian Eckert <redacted>
net/keepalived/Makefile
net/keepalived/files/keepalived.init

index 62f4373f727e0a8ff35873c20b801e125d28f65f..bf09b49927238f521bc4d214c51cd2644d0d813b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=keepalived
 PKG_VERSION:=2.2.8
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.keepalived.org/software
index 63beb298337403ab81f13a803c466cdb5b7a3a7d..804c6213ee6589a5380c02cea1eeeba8f4a58dad 100644 (file)
@@ -105,6 +105,11 @@ globals() {
        printf '%benable_script_security\n' "${INDENT_1}" >> "$KEEPALIVED_CONF"
        printf '%bprocess_names\n' "${INDENT_1}" >> "$KEEPALIVED_CONF"
 
+       printf '%bstartup_script "/bin/busybox env -i ACTION=startup /sbin/hotplug-call keepalived"\n' "${INDENT_1}" >> "$KEEPALIVED_CONF"
+       printf '%bstartup_script_timeout 10\n' "${INDENT_1}" >> "$KEEPALIVED_CONF"
+       printf '%bshutdown_script "/bin/busybox env -i ACTION=shutdown /sbin/hotplug-call keepalived"\n' "${INDENT_1}" >> "$KEEPALIVED_CONF"
+       printf '%bshutdown_script_timeout 10\n' "${INDENT_1}" >> "$KEEPALIVED_CONF"
+
        config_get notification_email "$1" notification_email
        print_list_indent notification_email
 
git clone https://git.99rst.org/PROJECT