Hi Adrian,

Adrian Bridgett [2006-03-21 11:35 +0000]:
> /etc/init.d/postgresql-8.1 status always returns 0 (it just backs this
> call off to /usr/share/postgresql-common/init.d-functions hence the
> bug on postgresql-common).
> 
> This causes issues with HA since it requires LSB compliant scripts -
> in particular status should return "3" if postgresql is down.

Thanks for your report. It's not trivial, since you can have
arbitrarily many clusters which can be running, or down (even
deliberately) independently of each other.

> I've attached a short patch to do this, however it's not as clean as
> it should be 

It's not easy to define a semantics for that init script which makes
sense. However, in any case I can add a 'status' command to
pg_ctlcluster which returns LSB conformant exit codes, so that there
is a tool to check a particular cluster. This could then be integrated
into the init script somehow.

> since there is a global "exit 0" in the
> /etc/init.d/postgresql-8.1 script (why?!).

That's common practice for init scripts, since they usually abort
immediately on errors (due to set -e). I just saw that the
postgresql-X.Y scripts forgot this, thanks for making me aware of
that. :)

Martin

-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

In a world without walls and fences, who needs Windows and Gates?

Attachment: signature.asc
Description: Digital signature

Reply via email to