From 644d72ef422e93a3b8db37975e436851f72b60f3 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 b382107aa..211754ba4 100644 --- a/src/test/pgpool_setup.in +++ b/src/test/pgpool_setup.in @@ -928,8 +928,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