Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44a9639

Browse files
committed
Detect postmaster being ready by calling psql -l rathern than
checking postmaster.pid. It's not enough to check the existenceof postmaster.pid since DB recovery might be running.
1 parent6217a8c commit44a9639

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎src/bin/pg_ctl/pg_ctl.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.9 2000/02/07 04:31:10 ishii Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.10 2000/03/14 08:34:47 ishii Exp $
1212
#
1313
#-------------------------------------------------------------------------
1414
CMDNAME=`basename$0`
@@ -47,7 +47,7 @@ else
4747
fi
4848

4949
# Check if needed programs actually exist in path
50-
forprogin postmaster
50+
forprogin postmaster psql
5151
do
5252
if [!-x"$PGPATH/$prog" ]
5353
then
@@ -245,16 +245,17 @@ if [ $op = "start" -o $op = "restart" ];then
245245
$ECHO_N"Waiting for postmaster starting up.."$ECHO_C
246246
while:
247247
do
248-
if [!-f$PIDFILE ];then
248+
if psql -l>/dev/null2>&1
249+
then
250+
break;
251+
else
249252
$ECHO_N"."$ECHO_C
250253
cnt=`expr$cnt + 1`
251254
if [$cnt-gt 60 ];then
252255
$ECHO"$CMDNAME: postmaster does not start up"
253256
exit 1
254257
fi
255258
sleep 1
256-
else
257-
break
258259
fi
259260
done
260261
$ECHO"done."

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp