File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- # $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.22 2001/09/16 16:11:11 petere Exp $
2
+ # $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.23 2002/01/03 21:52:05 tgl Exp $
3
3
4
4
me=` basename $0 `
5
5
: ${TMPDIR=/ tmp}
@@ -353,6 +353,27 @@ then
353
353
" $bindir /postmaster" -D " $PGDATA " -F $postmaster_options > " $LOGDIR /postmaster.log" 2>&1 &
354
354
postmaster_pid=$!
355
355
356
+ # Wait till postmaster is able to accept connections (normally only
357
+ # a second or so, but Cygwin is reportedly *much* slower). Don't
358
+ # wait forever, however.
359
+ i=0
360
+ max=60
361
+ until " $bindir /psql" $psql_options template1 < /dev/null 2> /dev/null
362
+ do
363
+ i=` expr $i + 1`
364
+ if [ $i -ge $max ]
365
+ then
366
+ break
367
+ fi
368
+ if kill -0 $postmaster_pid > /dev/null 2>&1
369
+ then
370
+ : still starting up
371
+ else
372
+ break
373
+ fi
374
+ sleep 1
375
+ done
376
+
356
377
if kill -0 $postmaster_pid > /dev/null 2>&1
357
378
then
358
379
echo " running on port $PGPORT with pid $postmaster_pid "
364
385
(exit 2); exit
365
386
fi
366
387
367
- # give postmaster some time to pass WAL recovery
368
- sleep 3
369
-
370
388
else # not temp-install
371
389
372
390
# If Unix sockets are not available, use the local host by default.
You can’t perform that action at this time.
0 commit comments