James Gregory wrote:
> On Wed, 2003-01-29 at 20:36, Guillaume Rousse wrote:
> 
>>Le Mercredi 29 Janvier 2003 08:12, James Gregory a écrit :
>>
>>>On Wed, 2003-01-29 at 18:04, James Gregory wrote:
>>>
>>>>I suspect the culprit is this line:
>>>>
>>>>su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p
>>>>/usr/bin/postmaster -o '-p ${PGPORT}' start  > /dev/null 2>&1" <
>>>>/dev/null
>>>
>>>... indeed it was. I'm now using this:
>>>
>>>su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p
>>>/usr/bin/postmaster -o '-p ${PGPORT} ${PGOPTS}' start  > /dev/null 2>&1"
>>>< /dev/null

[...]

> I think that either my modification (well, a variation which tests
> whether PGOPTS is set) should be applied or the section that exports
> PGOPTS should be removed and a note placed there that all configuration
> (including -i) should be done in the relevant configuration file (and
> name said configuration file)
> 
> There should be *one* way to configure these things, and it should be
> easy.
> 

Haven't tried this, and am not sure how the args should be passed (ie
should -o be passed if PGOPTS isn't set but PGPORT it?) but it would be
something like this:

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p \
/usr/bin/postmaster ${PGOPTS:+'-o'} '-p ${PGPORT:+'-p '}${PGPORT} \
 ${PGOPTS}' start  > \
/dev/null 2>&1" < /dev/null

(I think, but the script may have been mangled by the mail before I
looked at it ..).

(
[bgmilne@bgmilne bgmilne]$ unset MYVAR
[bgmilne@bgmilne bgmilne]$ echo ${MYVAR:+'-o '}${MYVAR}

[bgmilne@bgmilne bgmilne]$ MYVAR=yo
[bgmilne@bgmilne bgmilne]$ echo ${MYVAR:+'-o '}${MYVAR}
-o yo
[bgmilne@bgmilne bgmilne]$
)

Buchan

-- 
|--------------Another happy Mandrake Club member--------------|
Buchan Milne                Mechanical Engineer, Network Manager
Cellphone * Work            +27 82 472 2231 * +27 21 8828820x121
Stellenbosch Automotive Engineering         http://www.cae.co.za
GPG Key                   http://ranger.dnsalias.com/bgmilne.asc
1024D/60D204A7 2919 E232 5610 A038 87B1 72D6 AC92 BA50 60D2 04A7


Reply via email to