[Fusionforge-commits] r8961 - trunk/gforge/debian/dsf-in

Christian Bayle cbayle at libremir.placard.fr.eu.org
Sat Mar 6 00:27:17 CET 2010


Author: cbayle
Date: 2010-03-06 00:27:17 +0100 (Sat, 06 Mar 2010)
New Revision: 8961

Modified:
   trunk/gforge/debian/dsf-in/db-postgresql.postinst.dsfh-in
   trunk/gforge/debian/dsf-in/db-postgresql.prerm
Log:
Try to start the db when found down


Modified: trunk/gforge/debian/dsf-in/db-postgresql.postinst.dsfh-in
===================================================================
--- trunk/gforge/debian/dsf-in/db-postgresql.postinst.dsfh-in	2010-03-05 23:26:39 UTC (rev 8960)
+++ trunk/gforge/debian/dsf-in/db-postgresql.postinst.dsfh-in	2010-03-05 23:27:17 UTC (rev 8961)
@@ -13,8 +13,8 @@
 	# or I quit gently with a big message
 	for i in 1 2 3
 	do
-		pg_version_offline=`pg_lsclusters | grep 5432 | grep offline | cut -d' ' -f1`
-		if [ "x$pg_version" != "x" ]
+		pg_version_down=`pg_lsclusters | grep 5432 | grep down | cut -d' ' -f1`
+		if [ "x$pg_version_down" != "x" ]
 		then
 			invoke-rc.d postgresql-$pg_version start
 			sleep $i
@@ -93,5 +93,3 @@
 # generated by other debhelper scripts.
 
 #DEBHELPER#
-
-exit 0

Modified: trunk/gforge/debian/dsf-in/db-postgresql.prerm
===================================================================
--- trunk/gforge/debian/dsf-in/db-postgresql.prerm	2010-03-05 23:26:39 UTC (rev 8960)
+++ trunk/gforge/debian/dsf-in/db-postgresql.prerm	2010-03-05 23:27:17 UTC (rev 8961)
@@ -11,19 +11,24 @@
 	# This is probably not te most elegant way to deal with database
 	# I install or upgrade on the default cluster if it is online
 	# or I quit gently with a big message
+	pg_version_down=`pg_lsclusters | grep 5432 | grep down | cut -d' ' -f1`
+	if [ "x$pg_version_down" != "x" ] 
+	then
+		update-rc.d postgresql-$pg_version_down start
+	fi
 	pg_version=`pg_lsclusters | grep 5432 | grep online | cut -d' ' -f1`
 	if [ "x$pg_version" != "x" ] 
 	then 
 		export pg_hba_dir=/etc/postgresql/${pg_version}/main/
 	else
-		echo "No database found online on port 5432"
-		echo "Couldn't initialize or upgrade @OLDPACKAGE@ database."
-		echo "Please see postgresql documentation"
-		echo "and run dpkg-reconfigure -plow @OLDPACKAGE at -db-postgresql"
-		echo "once the problem is solved"
-		echo "exiting without error, but @OLDPACKAGE@ db will not work"
-		echo "right now"
-		exit 0
+			echo "No database found online on port 5432"
+			echo "Couldn't initialize or upgrade @OLDPACKAGE@ database."
+			echo "Please see postgresql documentation"
+			echo "and run dpkg-reconfigure -plow @OLDPACKAGE at -db-postgresql"
+			echo "once the problem is solved"
+			echo "exiting without error, but @OLDPACKAGE@ db will not work"
+			echo "right now"
+			exit 0
 	fi
 else
     	export pg_hba_dir=/etc/postgresql
@@ -69,5 +74,3 @@
 # generated by other debhelper scripts.
 
 #DEBHELPER#
-
-exit 0




More information about the Fusionforge-commits mailing list