Package: postgresql-common
Version: 46
/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. I've
attached a short patch to do this, however it's not as clean as it
should be since there is a global "exit 0" in the
/etc/init.d/postgresql-8.1 script (why?!). References:
http://www.linux-ha.org/LSBResourceAgent
http://www.linuxbase.org/spec/refspecs/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
Many thanks,
Adrian
--
Email: [EMAIL PROTECTED] -*- GPG key available on public key servers
Debian GNU/Linux - the maintainable distribution -*- www.debian.org
Avoid working with children, animals and Microsoft "operating" systems
--- /usr/share/postgresql-common/init.d-functions.orig 2006-03-21
11:25:23.623206477 +0000
+++ /usr/share/postgresql-common/init.d-functions 2006-03-21
11:32:14.031388394 +0000
@@ -69,7 +69,8 @@
}
status() {
- pg_lsclusters
+ pg_lsclusters | awk 'BEGIN {rc=3} {print; if ($4 == "online") rc=0} END {
exit rc }'
+ exit $?
}
# start pg_autovacuum for all clusters of version $1