Catch calls to restart Postgres and translate them into a sequential
[invirt/packages/invirt-database.git] / server / etc / init.d / postgresql-8.3.invirt
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
+
+: