Re: Alternate data location, again - Mailing list pgsql-general

From Rich Shepard
Subject Re: Alternate data location, again
Date
Msg-id Pine.LNX.4.44.0202191111260.2118-100000@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: Alternate data location, again  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Alternate data location, again
List 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@appl-ecosys.com
                         http://www.appl-ecosys.com


pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Report generation
Next
From: Rich Shepard
Date:
Subject: Re: Table creation syntax