Index: trunk/packages/sipb-xen-database/debian/changelog
===================================================================
--- trunk/packages/sipb-xen-database/debian/changelog	(revision 1149)
+++ trunk/packages/sipb-xen-database/debian/changelog	(revision 1152)
@@ -1,2 +1,9 @@
+sipb-xen-database (10.33) unstable; urgency=low
+
+  * Catch calls to restart Postgres and translate them into a sequential
+    stop, then start
+
+ -- Evan Broder <broder@mit.edu>  Mon, 20 Oct 2008 13:05:29 -0400
+
 sipb-xen-database (10.32) unstable; urgency=low
 
Index: trunk/packages/sipb-xen-database/debian/rules
===================================================================
--- trunk/packages/sipb-xen-database/debian/rules	(revision 1149)
+++ trunk/packages/sipb-xen-database/debian/rules	(revision 1152)
@@ -4,6 +4,6 @@
 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
Index: trunk/packages/sipb-xen-database/server/etc/init.d/postgresql-8.3.invirt
===================================================================
--- trunk/packages/sipb-xen-database/server/etc/init.d/postgresql-8.3.invirt	(revision 1152)
+++ trunk/packages/sipb-xen-database/server/etc/init.d/postgresql-8.3.invirt	(revision 1152)
@@ -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
+
+:
