From 384c17eaba1dad802c9f81b4057ba6ce76417e2d Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Fri, 22 Aug 2025 15:35:48 +0900 Subject: [PATCH] Fix watchdog_setup bug. Fix bug in commit 534e04a0e. - If no argument is specified, watchdog_setup complains a shell script error. - When VIP is requested, delegate_ip, if_up_cmd and if_up_cmd are added to pgpool.conf multiple times. Reviewed-by: Bo Peng --- src/test/watchdog_setup.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/watchdog_setup.in b/src/test/watchdog_setup.in index dfa362471..c64152451 100644 --- a/src/test/watchdog_setup.in +++ b/src/test/watchdog_setup.in @@ -199,15 +199,16 @@ EOF echo "wd_port$n = $wd_port" >> $conf echo "heartbeat_hostname$n = 'localhost'" >> $conf echo "heartbeat_port$n = $wd_heartbeat_port" >> $conf - if [ $VIP != "" ];then - echo "delegate_ip = '$VIP'" >> $conf - echo "if_up_cmd = '/usr/bin/echo \"if_up_cmd executed\"'" >> $conf - echo "if_down_cmd = 'usr/bin/echo \"if_down_cmd executed\"'" >> $conf - echo "arping_cmd = '/usr/bin/true'" >> $conf - fi n=`expr $n + 1` done + if [ "$VIP" != "" ];then + echo "delegate_ip = '$VIP'" >> $conf + echo "if_up_cmd = '/usr/bin/echo \"if_up_cmd executed\"'" >> $conf + echo "if_down_cmd = 'usr/bin/echo \"if_down_cmd executed\"'" >> $conf + echo "arping_cmd = '/usr/bin/true'" >> $conf + fi + echo "$id" >> $node_id_file } -- 2.39.5