From: Francesco Benini Date: Sat, 19 Oct 2024 23:19:23 +0000 (+0200) Subject: keepalived: fix ambigiuos functions in hotplug.sh X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=ac72a52fd90a7a0690965d2816d0bae9d7400449;p=openwrt-packages.git keepalived: fix ambigiuos functions in hotplug.sh When "set_reload_if_sync" is not set in the hotplug script, the service is not expected to reload. That is not true because even if not set, the value is set to the default 1 (reload active) or equals the parameter set when "keepalived_hotplug" is called. The default behavior should be:     - Reload if set_reload_if_sync is called     - NOT reload if set_reload_if_sync is NOT called A similar fix is ported to "set_update_target". Signed-off-by: Francesco Benini --- diff --git a/net/keepalived/Makefile b/net/keepalived/Makefile index 21ec9f73d..312923987 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:=8 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.keepalived.org/software diff --git a/net/keepalived/files/lib/functions/keepalived/hotplug.sh b/net/keepalived/files/lib/functions/keepalived/hotplug.sh index 57db374e2..5bd96d5cf 100644 --- a/net/keepalived/files/lib/functions/keepalived/hotplug.sh +++ b/net/keepalived/files/lib/functions/keepalived/hotplug.sh @@ -82,7 +82,7 @@ is_sync_file() { list_contains SYNC_FILES_LIST "$1" } -set_update_target() { +_set_update_target() { set_var UPDATE_TARGET "${1:-1}" } @@ -90,8 +90,8 @@ get_update_target() { get_var UPDATE_TARGET } -unset_update_target() { - set_var UPDATE_TARGET +set_disable_update_target() { + _set_update_target 0 } is_update_target() { @@ -170,8 +170,12 @@ skip_running_check() { get_var_flag NOTIFY_SKIP_RUNNING } +_set_reload_if_sync() { + set_var NOTIFY_SYNC_RELOAD "${1:-0}" +} + set_reload_if_sync() { - set_var NOTIFY_SYNC_RELOAD "${1:-1}" + _set_reload_if_sync 1 } get_reload_if_sync() { @@ -257,8 +261,8 @@ keepalived_hotplug() { [ -z "$(get_fault_cb)" ] && set_fault_cb _notify_fault [ -z "$(get_sync_cb)" ] && set_sync_cb _notify_sync - [ -z "$(get_update_target)" ] && set_update_target "$@" - [ -z "$(get_reload_if_sync)" ] && set_reload_if_sync "$@" + [ -z "$(get_update_target)" ] && _set_update_target "$@" + [ -z "$(get_reload_if_sync)" ] && _set_reload_if_sync "$@" case $ACTION in NOTIFY_MASTER) call_cb "$(get_master_cb)" ;;