checking postmaster.pid. It's not enough to check the existence
of postmaster.pid since DB recovery might be running.
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.9 2000/02/07 04:31:10 ishii Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.10 2000/03/14 08:34:47 ishii Exp $
#
#-------------------------------------------------------------------------
CMDNAME=`basename $0`
fi
# Check if needed programs actually exist in path
-for prog in postmaster
+for prog in postmaster psql
do
if [ ! -x "$PGPATH/$prog" ]
then
$ECHO_N "Waiting for postmaster starting up.."$ECHO_C
while :
do
- if [ ! -f $PIDFILE ];then
+ if psql -l >/dev/null 2>&1
+ then
+ break;
+ else
$ECHO_N "."$ECHO_C
cnt=`expr $cnt + 1`
if [ $cnt -gt 60 ];then
exit 1
fi
sleep 1
- else
- break
fi
done
$ECHO "done."