Skip to content

Commit ba16df9

Browse files
committed
Propogate pg_ctl -D to the postmaster as a -D flag for identification by
ps for multiple postmasters, for Kevin Brown.
1 parent 2dde90a commit ba16df9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/bin/pg_ctl/pg_ctl.sh

Lines changed: 7 additions & 4 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.30 2002/10/18 22:05:35 petere Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.31 2003/02/14 22:18:25 momjian Exp $
1212
#
1313
#-------------------------------------------------------------------------
1414

@@ -115,6 +115,8 @@ wait_seconds=60
115115
logfile=
116116
silence_echo=
117117
shutdown_mode=smart
118+
PGDATAOPTS=""
119+
POSTOPTS=""
118120

119121
while [ "$#" -gt 0 ]
120122
do
@@ -129,7 +131,8 @@ do
129131
;;
130132
-D)
131133
shift
132-
# pass environment into new postmaster
134+
# we need to do this so -D datadir shows in ps display
135+
PGDATAOPTS="-D $1"
133136
PGDATA="$1"
134137
export PGDATA
135138
;;
@@ -333,12 +336,12 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
333336
fi
334337

335338
if [ -n "$logfile" ]; then
336-
"$po_path" ${1+"$@"} </dev/null >>$logfile 2>&1 &
339+
"$po_path" ${1+"$@"} ${PGDATAOPTS+$PGDATAOPTS} </dev/null >>$logfile 2>&1 &
337340
else
338341
# when starting without log file, redirect stderr to stdout, so
339342
# pg_ctl can be invoked with >$logfile and still have pg_ctl's
340343
# stderr on the terminal.
341-
"$po_path" ${1+"$@"} </dev/null 2>&1 &
344+
"$po_path" ${1+"$@"} ${PGDATAOPTS+$PGDATAOPTS} </dev/null 2>&1 &
342345
fi
343346

344347
# if had an old lockfile, check to see if we were able to start

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy