keepalived: add track_script to vrrp_sync_group
authorRishabh <redacted>
Mon, 20 Apr 2026 16:41:23 +0000 (22:11 +0530)
committerFlorian Eckert <redacted>
Mon, 27 Apr 2026 12:28:04 +0000 (14:28 +0200)
Add logic to parse track_script section for vrrp_sync_group.
Keepalived supports script tracking in vrrp_sync_group but this was not
implemented by the uci implementation.

Note that if a vrrp_script is added to a sync group, you cannot use
priority/weight for that script as a vrrp_sync_group does not have a
priority/weight attached to it. It will do up/down as whole.

This option is optional and wouldn't affect any older configurations
during upgrade.

Signed-off-by: Rishabh <redacted>
net/keepalived/files/keepalived.init

index 3e9c99faf95a16491cf6f1193a198f81a54a51cc..aa6870f09aa6e8d523713c3f607db84d25ea13b7 100644 (file)
@@ -357,6 +357,17 @@ vrrp_sync_group() {
 
        print_elems_indent "$1" "$INDENT_1" no_val_smtp_alert no_val_global_tracking
 
+       # Handle track_script list for sync group
+       local track_script_val
+       config_get track_script_val "$1" track_script
+       if [ -n "$track_script_val" ]; then
+               config_section_open "track_script" "" "$INDENT_1"
+               for t in $track_script_val; do
+                       config_foreach print_track_script_indent vrrp_script "$t" "$INDENT_2"
+               done
+               config_section_close "$INDENT_1"
+       fi
+
        print_notify "GROUP" "$name" "$INDENT_1" notify_backup notify_master \
                notify_fault notify
 
git clone https://git.99rst.org/PROJECT