|
8 | 8 | #
|
9 | 9 | #
|
10 | 10 | # 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 $ |
12 | 12 | #
|
13 | 13 | #-------------------------------------------------------------------------
|
14 | 14 |
|
@@ -293,9 +293,10 @@ if [ $op = "stop" -o $op = "restart" ];then
|
293 | 293 | fi# stop or restart
|
294 | 294 |
|
295 | 295 | if [$op="start"-o$op="restart" ];then
|
| 296 | + oldpid="" |
296 | 297 | if [-f$PIDFILE ];then
|
297 |
| -echo"$CMDNAME:It seems anotherpostmasteris running. Trying to start postmaster anyway."1>&2 |
298 |
| -pid=`sed -n 1p$PIDFILE` |
| 298 | +echo"$CMDNAME:Anotherpostmastermay be running. Trying to start postmaster anyway."1>&2 |
| 299 | +oldpid=`sed -n 1p$PIDFILE` |
299 | 300 | fi
|
300 | 301 |
|
301 | 302 | unset logopt
|
@@ -330,11 +331,15 @@ if [ $op = "start" -o $op = "restart" ];then
|
330 | 331 |
|
331 | 332 | eval'$po_path''$POSTOPTS'$logopt'&'
|
332 | 333 |
|
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 |
338 | 343 | fi
|
339 | 344 | fi
|
340 | 345 |
|
|