8
8
#
9
9
#
10
10
# IDENTIFICATION
11
- # $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.24 2001/09/21 21:10:56 tgl Exp $
11
+ # $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.25 2001/09/29 03:09:32 momjian Exp $
12
12
#
13
13
# -------------------------------------------------------------------------
14
14
@@ -238,9 +238,9 @@ POSTOPTSFILE=$PGDATA/postmaster.opts
238
238
PIDFILE=$PGDATA /postmaster.pid
239
239
240
240
if [ " $op " = " status" ]; then
241
- if [ -f $PIDFILE ]; then
241
+ if [ -f " $PIDFILE " ]; then
242
242
PID=` sed -n 1p $PIDFILE `
243
- if [ $PID -lt 0 ]; then
243
+ if [ " $PID " -lt 0 ]; then
244
244
PID=` expr 0 - $PID `
245
245
echo " $CMDNAME : postgres is running (pid: $PID )"
246
246
else
@@ -256,9 +256,9 @@ if [ "$op" = "status" ];then
256
256
fi
257
257
258
258
if [ " $op " = " stop" -o " $op " = " restart" -o " $op " = " reload" ]; then
259
- if [ -f $PIDFILE ]; then
259
+ if [ -f " $PIDFILE " ]; then
260
260
PID=` sed -n 1p $PIDFILE `
261
- if [ $PID -lt 0 ]; then
261
+ if [ " $PID " -lt 0 ]; then
262
262
PID=` expr 0 - $PID `
263
263
echo " $CMDNAME : Cannot restart postmaster. postgres is running (pid: $PID )" 1>&2
264
264
echo " Please terminate postgres and try again." 1>&2
@@ -274,10 +274,10 @@ if [ "$op" = "stop" -o "$op" = "restart" -o "$op" = "reload" ];then
274
274
275
275
while :
276
276
do
277
- if [ -f $PIDFILE ]; then
277
+ if [ -f " $PIDFILE " ]; then
278
278
$silence_echo $ECHO_N " ." $ECHO_C
279
279
cnt=` expr $cnt + 1`
280
- if [ $cnt -gt $wait_seconds ]; then
280
+ if [ " $cnt " -gt " $wait_seconds " ]; then
281
281
$silence_echo echo " failed"
282
282
echo " $CMDNAME : postmaster does not shut down" 1>&2
283
283
exit 1
@@ -309,7 +309,7 @@ fi # stop, restart, reload
309
309
310
310
if [ " $op " = " start" -o " $op " = " restart" ]; then
311
311
oldpid=" "
312
- if [ -f $PIDFILE ]; then
312
+ if [ -f " $PIDFILE " ]; then
313
313
echo " $CMDNAME : Another postmaster may be running. Trying to start postmaster anyway." 1>&2
314
314
oldpid=` sed -n 1p $PIDFILE `
315
315
fi
@@ -318,7 +318,7 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
318
318
if [ -z " $POSTOPTS " ]; then
319
319
if [ " $op " = " start" ]; then
320
320
# if we are in start mode, then look for postmaster.opts.default
321
- if [ -f $DEFPOSTOPTS ]; then
321
+ if [ -f " $DEFPOSTOPTS " ]; then
322
322
eval set X " ` cat $DEFPOSTOPTS ` " ; shift
323
323
fi
324
324
else
@@ -343,7 +343,7 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
343
343
# if had an old lockfile, check to see if we were able to start
344
344
if [ -n " $oldpid " ]; then
345
345
sleep 1
346
- if [ -f $PIDFILE ]; then
346
+ if [ -f " $PIDFILE " ]; then
347
347
if [ " ` sed -n 1p $PIDFILE ` " = " $oldpid " ]; then
348
348
echo " $CMDNAME : cannot start postmaster" 1>&2
349
349
echo " Examine the log output." 1>&2
@@ -376,7 +376,7 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
376
376
else
377
377
$silence_echo $ECHO_N " ." $ECHO_C
378
378
cnt=` expr $cnt + 1`
379
- if [ $cnt -gt $wait_seconds ]; then
379
+ if [ " $cnt " -gt " $wait_seconds " ]; then
380
380
$silence_echo echo " failed"
381
381
echo " $CMDNAME : postmaster does not start" 1>&2
382
382
exit 1
0 commit comments