From d8cdfc62a338172385d569eeaf258993918ea7f7 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Tue, 2 Feb 2021 23:12:37 +0900 Subject: [PATCH] Enhance pgpool_setup. "shutdownall" script unconditionally waited for the pgpool.pid file is gone after "pgpool stop". But if invalid pgpool.pid file exists, it waits forever. To avoid this check the exit status of "pgpool stop" and only wait if the exit status is 0. --- src/test/pgpool_setup.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/pgpool_setup.in b/src/test/pgpool_setup.in index 389bcc0c9..65c0df926 100644 --- a/src/test/pgpool_setup.in +++ b/src/test/pgpool_setup.in @@ -902,8 +902,7 @@ echo "PGPOOL_INSTALL_DIR=$PGPOOL_INSTALL_DIR" >> $STARTALL chmod 755 $STARTALL echo 'dir=`pwd`' > $SHUTDOWNALL echo "PGPOOL_INSTALL_DIR=$PGPOOL_INSTALL_DIR" >> $SHUTDOWNALL -echo '$PGPOOL_INSTALL_DIR/bin/pgpool -f $dir/etc/pgpool.conf -m f stop' >> $SHUTDOWNALL -echo 'while [ -f $dir/run/pgpool.pid ];do sleep 1;done' >> $SHUTDOWNALL +echo '$PGPOOL_INSTALL_DIR/bin/pgpool -f $dir/etc/pgpool.conf -m f stop && while [ -f $dir/run/pgpool.pid ];do sleep 1;done' >> $SHUTDOWNALL if [ $CHECK_TIME_WAIT != "false" ];then echo "while netstat -a|grep $ORIGBASEPORT ;do sleep 1;done" >> $SHUTDOWNALL fi -- 2.39.5