keepalived: add notify_up and notify_down for virtual server 22298/head
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 10 Nov 2022 14:04:11 +0000 (15:04 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Wed, 4 Oct 2023 15:01:04 +0000 (17:01 +0200)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/keepalived/Makefile
net/keepalived/files/keepalived.init

index 3ca584a37159be2ca8264e00d2c8566e3735559f..62f4373f727e0a8ff35873c20b801e125d28f65f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=keepalived
 PKG_VERSION:=2.2.8
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.keepalived.org/software
index 77f1e1778fc39f5f79e67e87229b943a0e39614e..63beb298337403ab81f13a803c466cdb5b7a3a7d 100644 (file)
@@ -88,8 +88,11 @@ print_notify() {
        shift
        local name="$1"
        shift
+       local indent="$1"
+       shift
+
        for notify in "$@"; do
-               printf '%b%s' "${INDENT_1}" "$notify">> "$KEEPALIVED_CONF"
+               printf '%b%s' "${indent}" "$notify">> "$KEEPALIVED_CONF"
                notify="$(echo "$notify" | tr 'a-z' 'A-Z')"
                printf ' "/bin/busybox env -i ACTION=%s TYPE=%s NAME=%s /sbin/hotplug-call keepalived"\n' "$notify" "$type" "$name" >> "$KEEPALIVED_CONF"
        done
@@ -320,7 +323,7 @@ vrrp_sync_group() {
 
        print_elems_indent "$1" "$INDENT_1" no_val_smtp_alert no_val_global_tracking
 
-       print_notify "GROUP" "$name" notify_backup notify_master \
+       print_notify "GROUP" "$name" "$INDENT_1" notify_backup notify_master \
                notify_fault notify
 
        config_section_close
@@ -352,7 +355,7 @@ vrrp_instance() {
                no_val_dont_track_primary no_val_smtp_alert no_val_nopreempt \
                no_val_use_vmac
 
-       print_notify "INSTANCE" "$name" notify_backup notify_master \
+       print_notify "INSTANCE" "$name" "$INDENT_1" notify_backup notify_master \
                notify_fault notify_stop
 
        # Handle virtual_ipaddress & virtual_ipaddress_excluded lists
@@ -501,6 +504,7 @@ real_server() {
        [ -n "$ipaddr" ] && [ -n "$port" ] && {
                printf '%breal_server %s %d {\n' "${INDENT_1}" "$ipaddr" "$port" >> "$KEEPALIVED_CONF"
                printf '%bweight %d\n' "${INDENT_2}" "$weight" >> "$KEEPALIVED_CONF"
+               print_notify "REAL_SERVER" "$name" "$INDENT_2" notify_up notify_down
                case "$check" in
                        PING_CHECK)
                                printf '%b%s {\n' "${INDENT_2}" "$check" >> "$KEEPALIVED_CONF"