From: Evan Broder Date: Mon, 20 Oct 2008 17:06:03 +0000 (-0400) Subject: Catch calls to restart Postgres and translate them into a sequential X-Git-Tag: sipb-xen-database/10.33^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-database.git/commitdiff_plain/49a5555d50b72a14ee16d70dc9612ab022061592?ds=sidebyside Catch calls to restart Postgres and translate them into a sequential stop, then start svn path=/trunk/packages/sipb-xen-database/; revision=1152 --- diff --git a/debian/changelog b/debian/changelog index 0482b1e..b98b9d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +sipb-xen-database (10.33) unstable; urgency=low + + * Catch calls to restart Postgres and translate them into a sequential + stop, then start + + -- Evan Broder Mon, 20 Oct 2008 13:05:29 -0400 + sipb-xen-database (10.32) unstable; urgency=low * invirt.database.clear_cache should actually do something diff --git a/debian/rules b/debian/rules index c797897..c5d84e2 100755 --- a/debian/rules +++ b/debian/rules @@ -3,8 +3,8 @@ DEB_DIVERT_EXTENSION = .invirt DEB_DIVERT_FILES_sipb-xen-database-server += \ -/etc/postgresql/8.3/main/postgresql.conf.invirt - + /etc/postgresql/8.3/main/postgresql.conf.invirt \ + /etc/init.d/postgresql-8.3.invirt include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/config-package.mk diff --git a/server/etc/init.d/postgresql-8.3.invirt b/server/etc/init.d/postgresql-8.3.invirt new file mode 100755 index 0000000..1e8ca4d --- /dev/null +++ b/server/etc/init.d/postgresql-8.3.invirt @@ -0,0 +1,29 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: postgresql postgresql-8.3 +# Required-Start: $local_fs $remote_fs $network $time +# Required-Stop: $local_fs $remote_fs $network $time +# Should-Start: $syslog +# Should-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: PostgreSQL 8.3 RDBMS server +# Description: This script proxies requests to the default postgresql-8.3, +# except for restart, which it translates to a stop request, +# and then a start request, so that PostgreSQL is shut down +# with a fast shutdown +### END INIT INFO + +case "$1" in + restart) + invoke-rc.d postgresql-8.3.invirt-orig stop + invoke-rc.d postgresql-8.3.invirt-orig start + exit $? + ;; + *) + invoke-rc.d postgresql-8.3.invirt-orig "$1" + exit $? + ;; +esac + +: