From: Florian Eckert Date: Fri, 20 Oct 2023 08:59:53 +0000 (+0200) Subject: keepalived: add startup and shutdown script handling X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=eb2ed206454ac72c73f0af0f5386cb7f5d79672d;p=openwrt-packages.git keepalived: add startup and shutdown script handling 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 --- diff --git a/net/keepalived/Makefile b/net/keepalived/Makefile index 62f4373f7..bf09b4992 100644 --- a/net/keepalived/Makefile +++ b/net/keepalived/Makefile @@ -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 diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 63beb2983..804c6213e 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -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