Re: Changing from default configuration options in 7.1?

From: Karl DeBisschop <karl(at)debisschop(dot)net>
To: Steve Wampler <swampler(at)noao(dot)edu>
Cc: postgres-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Changing from default configuration options in 7.1?
Date: 2001-04-20 06:25:03
Message-ID: 3ADFD63F.2B325AF8@debisschop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steve Wampler wrote:
>
> I just upgraded from 7.0.3 to 7.1 (using the RH rpms) with no
> major problems. Nice!
>
> However, I'm getting some strange behaviour from the init
> script (/etc/rc.d/init.d/postgresql). In particular, a
> restart when the database is running fails because the
> "sleep 2" in stop() is no longer long enough (on a dual-cpu
> PIII/650 machine!). So "pidof postmaster" returns a non-null
> value and *that* results in a syntax error:
>
> Checking postgresql installation: [ OK ]
> ./postgresql: [: 18209: unary operator expected

ISTM that every occurrence of

if [ $pid ]

should be

if [ -n "$pid" ]

>
> (I think the test should become something like "if [ -n "$pid" ];..."
> instead of just "if [ $pid ]", which at least prevents the
> syntax error...)
>
> Of course, fixing the syntax error isn't the main problem, which
> is that the shutdown of the old postmaster(s) hasn't completed yet,
> resulting in a "false positive" from the pidof operation.
>
> I bumped the "sleep 2" up to "sleep 5" and the problem went away.
> Surely there's a better fix?

In the stop() function, I use:

su -l postgres -c "/usr/bin/pg_ctl -D $PGDATA -w stop"

with no sleep at all

I sent both these changes to lamar during rc4, but I got no reply. I
don't know if he got them and determined that my patches were worthless,
or if they did not reach him. In any case, those two changes work for
me. YMMV.

--
Karl

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Willis, Ian (Ento, Canberra) 2001-04-20 06:31:38 RE: Best practice
Previous Message Hitesh Patel 2001-04-20 06:08:20 PL/Perl Question