Re: Alternate data location, again

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Alternate data location, again
Date: 2002-02-19 19:17:04
Message-ID: Pine.LNX.4.44.0202191111260.2118-100000@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 19 Feb 2002, Tom Lane wrote:

> Hm. I assume that init script does something like
> su postgres -c 'postmaster ...'

Tom,

In /etc/rc.d/init.d/postgresql I see:

else
#all systems go -- remove any stale lock files
rm -f /tmp/.s.PGSQL.* > /dev/null
echo -n "$PSQL_START"
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null
sleep 1
pid=pidof -s postmaster
if [ $pid ]
then
if echo "$TYPESET"|grep "declare -f success ()" >/dev/null
then
success "$PSQL_START"

which looks to me as if $PGDATA is hard-wired as the data directory
without checking to see if there is an alternate.

> Check the man page for "su". Usually there is some option needed to
> make "su" pick up the login environment of the target user. On HPUX
> you'd do
> su - postgres postmaster ...
> but I'm too lazy to go check it on other Unixen...

That's what we do when we ask for help. :-)

The '-l' means log in as the username following, and '-s' means to start a
shell and run the command ('-c') /usr/bin/pg_ctl.

Rich

Dr. Richard B. Shepard, President

Applied Ecosystem Services, Inc. (TM)
2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard(at)appl-ecosys(dot)com
http://www.appl-ecosys.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2002-02-19 19:26:21 Re: Table creation syntax
Previous Message Tom Lane 2002-02-19 19:10:16 Re: Table creation syntax