Catch calls to restart Postgres and translate them into a sequential sipb-xen-database/10.33
authorEvan Broder <broder@mit.edu>
Mon, 20 Oct 2008 17:06:03 +0000 (13:06 -0400)
committerEvan Broder <broder@mit.edu>
Mon, 20 Oct 2008 17:06:03 +0000 (13:06 -0400)
stop, then start

svn path=/trunk/packages/sipb-xen-database/; revision=1152

debian/changelog
debian/rules
server/etc/init.d/postgresql-8.3.invirt [new file with mode: 0755]

index 0482b1e..b98b9d6 100644 (file)
@@ -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 <broder@mit.edu>  Mon, 20 Oct 2008 13:05:29 -0400
+
 sipb-xen-database (10.32) unstable; urgency=low
 
   * invirt.database.clear_cache should actually do something
index c797897..c5d84e2 100755 (executable)
@@ -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 (executable)
index 0000000..1e8ca4d
--- /dev/null
@@ -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
+
+: