|
8 | 8 | # |
9 | 9 | # |
10 | 10 | # IDENTIFICATION |
11 | | -# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.19 2001/03/18 20:27:11 tgl Exp $ |
| 11 | +# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.20 2001/04/21 11:23:58 petere Exp $ |
12 | 12 | # |
13 | 13 | #------------------------------------------------------------------------- |
14 | 14 |
|
@@ -299,37 +299,33 @@ if [ $op = "start" -o $op = "restart" ];then |
299 | 299 | oldpid=`sed -n 1p $PIDFILE` |
300 | 300 | fi |
301 | 301 |
|
302 | | - unset logopt |
303 | | - if [ -n "$logfile" ]; then |
304 | | - logopt='</dev/null >>$logfile 2>&1' |
305 | | - else |
306 | | - # when starting without log file, redirect stderr to stdout, so |
307 | | - # pg_ctl can be invoked with >$logfile and still have pg_ctl's |
308 | | - # stderr on the terminal. |
309 | | - logopt='</dev/null 2>&1' |
310 | | - fi |
311 | | - |
312 | 302 | # no -o given |
313 | 303 | if [ -z "$POSTOPTS" ];then |
314 | 304 | if [ $op = "start" ];then |
315 | 305 | # if we are in start mode, then look for postmaster.opts.default |
316 | 306 | if [ -f $DEFPOSTOPTS ]; then |
317 | | - POSTOPTS=`cat $DEFPOSTOPTS` |
| 307 | + eval set X "`cat $DEFPOSTOPTS`"; shift |
318 | 308 | fi |
319 | | - POSTOPTS="-D $PGDATA $POSTOPTS" |
320 | 309 | else |
321 | 310 | # if we are in restart mode, then look for postmaster.opts |
322 | | - set X `cat $POSTOPTSFILE` |
323 | | - shift |
| 311 | + eval set X "`cat $POSTOPTSFILE`"; shift |
324 | 312 | po_path=$1 |
325 | 313 | shift |
326 | | - POSTOPTS=$@ |
327 | 314 | fi |
328 | 315 | else # -o given |
329 | | - POSTOPTS="-D $PGDATA $POSTOPTS" |
| 316 | + eval set X "$POSTOPTS"; shift |
330 | 317 | fi |
331 | 318 |
|
332 | | - eval '$po_path' '$POSTOPTS' $logopt '&' |
| 319 | + set X -D "$PGDATA" ${1+"$@"}; shift |
| 320 | + |
| 321 | + if [ -n "$logfile" ]; then |
| 322 | + "$po_path" "$@" </dev/null >>$logfile 2>&1 & |
| 323 | + else |
| 324 | + # when starting without log file, redirect stderr to stdout, so |
| 325 | + # pg_ctl can be invoked with >$logfile and still have pg_ctl's |
| 326 | + # stderr on the terminal. |
| 327 | + "$po_path" "$@" </dev/null 2>&1 & |
| 328 | + fi |
333 | 329 |
|
334 | 330 | # if had an old lockfile, check to see if we were able to start |
335 | 331 | if [ -n "$oldpid" ];then |
|
0 commit comments