Skip site navigation (1) Skip section navigation (2)

Re: We should Axe /contrib/start-scripts

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, Chander Ganesan <chander(at)otg-nc(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: We should Axe /contrib/start-scripts
Date: 2009-08-25 19:46:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Kevin Grittner wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote: 
>> Hmm.  As stated, I would expect pg_ctl to make it worse.
> I've been playing with this, and I think the problem was that we
> wanted a non-zero exit from the script if the start failed.  That's
> trivial with pg_ctl -w but not running postgres directly.  I guess I
> could run pg_ctl status in a loop after the start.
> The reason is that we don't want certain other processes attempting to
> start until and unless the database they use has started successfully.

Have you looked at what the Fedora script does?

Here's a snippet from my F11 system:

        $SU -l postgres -c "$PGENGINE/postmaster -p '$PGPORT' -D 
'$PGDATA' ${PGOPTS} &" >> "$PGLOG" 2>&1 < /dev/null
        sleep 2
        pid=`pidof -s "$PGENGINE/postmaster"`
        if [ $pid ] && [ -f "$PGDATA/" ]
                success "$PSQL_START"
                touch /var/lock/subsys/${NAME}
                head -n 1 "$PGDATA/" > 
                failure "$PSQL_START"

Doesn't seem that much harder than using pg_ctl.



In response to


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2009-08-25 19:48:07
Subject: Re: We should Axe /contrib/start-scripts
Previous:From: Kevin GrittnerDate: 2009-08-25 19:34:28
Subject: Re: We should Axe /contrib/start-scripts

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group