From eb2ed206454ac72c73f0af0f5386cb7f5d79672d Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 20 Oct 2023 10:59:53 +0200 Subject: [PATCH 1/2] 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 --- net/keepalived/Makefile | 2 +- net/keepalived/files/keepalived.init | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 From f9ed5a9f3af0c587b29e12f85fd9b82b8394be71 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 20 Oct 2023 11:30:43 +0200 Subject: [PATCH 2/2] keepalived: add missing no_accept option This commit adds the missing option 'no_accept'. Signed-off-by: Florian Eckert --- net/keepalived/Makefile | 2 +- net/keepalived/files/keepalived.init | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/Makefile b/net/keepalived/Makefile index bf09b4992..da44823c5 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:=4 +PKG_RELEASE:=5 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 804c6213e..cbbff4941 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -358,7 +358,7 @@ vrrp_instance() { garp_master_repeat garp_master_refresh_repeat \ no_val_vmac_xmit_base no_val_native_ipv6 no_val_accept \ no_val_dont_track_primary no_val_smtp_alert no_val_nopreempt \ - no_val_use_vmac + no_val_use_vmac no_val_no_accept print_notify "INSTANCE" "$name" "$INDENT_1" notify_backup notify_master \ notify_fault notify_stop