File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 88#
99#
1010# IDENTIFICATION
11- # $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.18 2001/02/08 19:39:24 petere Exp $
11+ # $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.19 2001/03/18 20:27:11 tgl Exp $
1212#
1313# -------------------------------------------------------------------------
1414
@@ -293,9 +293,10 @@ if [ $op = "stop" -o $op = "restart" ];then
293293fi # stop or restart
294294
295295if [ $op = " start" -o $op = " restart" ]; then
296+ oldpid=" "
296297 if [ -f $PIDFILE ]; then
297- echo " $CMDNAME : It seems another postmaster is running. Trying to start postmaster anyway." 1>&2
298- pid =` sed -n 1p $PIDFILE `
298+ echo " $CMDNAME : Another postmaster may be running. Trying to start postmaster anyway." 1>&2
299+ oldpid =` sed -n 1p $PIDFILE `
299300 fi
300301
301302 unset logopt
@@ -330,11 +331,15 @@ if [ $op = "start" -o $op = "restart" ];then
330331
331332 eval ' $po_path' ' $POSTOPTS' $logopt ' &'
332333
333- if [ -f $PIDFILE ]; then
334- if [ " ` sed -n 1p $PIDFILE ` " = " $pid " ]; then
335- echo " $CMDNAME : cannot start postmaster" 1>&2
336- echo " Examine the log output." 1>&2
337- exit 1
334+ # if had an old lockfile, check to see if we were able to start
335+ if [ -n " $oldpid " ]; then
336+ sleep 1
337+ if [ -f $PIDFILE ]; then
338+ if [ " ` sed -n 1p $PIDFILE ` " = " $oldpid " ]; then
339+ echo " $CMDNAME : cannot start postmaster" 1>&2
340+ echo " Examine the log output." 1>&2
341+ exit 1
342+ fi
338343 fi
339344 fi
340345
You can’t perform that action at this time.
0 commit comments