Hi

In order to ease maintenance and reduce downtimes, we would like in our 
environment to control ourselves when the postgresql clusters are shut down 
(in order to synchronize with pausing the bouncer for instance)
This is currently not possible with the debian postgresql packages, where a 
minor upgrade will shut down, upgrade and restart the cluster.
I propose the attached simple patch, adding a check on a /etc/postgresql-
common/disable-unattended-restart file. If that file is present, clusters are 
not stopped.
Would this behaviour change be acceptable ? If so, what is the proper way to 
submit a patch to the package ?

Thanks

 Pierre
diff --git a/debian/maintscripts-functions b/debian/maintscripts-functions
index c6f9bd4..d171f8e 100644
--- a/debian/maintscripts-functions
+++ b/debian/maintscripts-functions
@@ -109,13 +109,15 @@ or a similar command (see 'man pg_createcluster')." >&2
 }
 
 stop_version() {
-    if [ -x /etc/init.d/postgresql ] && [ ! -x /etc/init.d/postgresql-$1 ]; then
-       if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-                invoke-rc.d postgresql stop $1 || exit $?
-        else
-                /etc/init.d/postgresql stop $1 || exit $?
-        fi
+    if [ -e /etc/postgresql-common/disable-unattended-restart ]; then
+        if [ -x /etc/init.d/postgresql ] && [ ! -x /etc/init.d/postgresql-$1 ]; then
+            if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                    invoke-rc.d postgresql stop $1 || exit $?
+            else
+                    /etc/init.d/postgresql stop $1 || exit $?
+            fi
 
+        fi
     fi
 }
 

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Pkg-postgresql-public mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public

Reply via email to