Enhance pgpool_setup.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 2 Feb 2021 14:12:37 +0000 (23:12 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 2 Feb 2021 14:12:37 +0000 (23:12 +0900)
"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

index b382107aa578a0640b0fcd72ada9f2d95f1ec7d7..211754ba48da4bd9c27b695d2a82e6ed4847fe51 100644 (file)
@@ -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