From 29abdc8c1ba51ee78dafe6c4bfac04f1dba2692d Mon Sep 17 00:00:00 2001 From: Roland Mas Date: Fri, 21 Sep 2012 14:14:04 +0000 Subject: [PATCH] Merged from 5.1: Fail configuration of the -db-postgresql package if no database is available --- src/deb-specific/install-db.sh | 14 ++++---------- src/debian/changelog | 5 ++++- src/debian/dsf-in/db-postgresql.postinst | 9 ++------- src/debian/dsf-in/db-postgresql.prerm | 10 +++------- 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/deb-specific/install-db.sh b/src/deb-specific/install-db.sh index c2bf3ab..9b6f0f8 100755 --- a/src/deb-specific/install-db.sh +++ b/src/deb-specific/install-db.sh @@ -25,9 +25,8 @@ function get_pg_hba_dir() { export pg_hba_dir=/var/lib/pgsql/data/ return fi - echo "No pg_hba_dir found" - echo "exiting without error, but gforge db will not work" - exit 0 + echo "No pg_hba_dir found — exiting with error" + exit 1 } # this function export in var pg_version the version of postgresql @@ -47,13 +46,8 @@ function get_pg_version() { return fi echo "No database found online on port 5432" - echo "Couldn't initialize or upgrade gforge database." - echo "Please see postgresql documentation" - echo "and run dpkg-reconfigure -plow gforge-db-postgresql" - echo "once the problem is solved" - echo "exiting without error, but gforge db will not work" - echo "right now" - exit 0 + echo "Couldn't initialize or upgrade gforge database" + exit 1 } diff --git a/src/debian/changelog b/src/debian/changelog index 560f21f..ccfa860 100644 --- a/src/debian/changelog +++ b/src/debian/changelog @@ -110,12 +110,15 @@ fusionforge (5.1.1-9) UNRELEASED; urgency=low [ Roland Mas ] * Reinstate code running the Mediawiki SQL initialisation code from the package's postinst. + * Fail configuration of the -db-postgresql package if no database is + available, to prevent other packages from breaking things due to + misconfiguration. [ Thorsten Glaser ] * SECURITY: Upon user deletion, remove their Unix account as well * SECURITY: Do not disclose inaccessible groups on user_home/toplist - -- Thorsten Glaser Mon, 03 Sep 2012 14:07:16 +0200 + -- Roland Mas Fri, 21 Sep 2012 16:05:28 +0200 fusionforge (5.1.1-8) unstable; urgency=low diff --git a/src/debian/dsf-in/db-postgresql.postinst b/src/debian/dsf-in/db-postgresql.postinst index 3b6e7bc..d0abe33 100644 --- a/src/debian/dsf-in/db-postgresql.postinst +++ b/src/debian/dsf-in/db-postgresql.postinst @@ -17,13 +17,8 @@ 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@-db-postgresql" - echo "once the problem is solved" - echo "exiting without error, but @OLDPACKAGE@ db will not work" - echo "right now" - exit 0 + echo "Couldn't initialize or upgrade @OLDPACKAGE@ database" + exit 1 fi else export pg_hba_dir=/etc/postgresql diff --git a/src/debian/dsf-in/db-postgresql.prerm b/src/debian/dsf-in/db-postgresql.prerm index ce26755..ace8a9e 100644 --- a/src/debian/dsf-in/db-postgresql.prerm +++ b/src/debian/dsf-in/db-postgresql.prerm @@ -16,13 +16,9 @@ then 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@-db-postgresql" - echo "once the problem is solved" - echo "exiting without error, but @OLDPACKAGE@ db will not work" - echo "right now" + echo "No database found online on port 5432." + echo "Assuming the database was dropped and no action is needed." + echo "Exiting without error, but make sure there are no leftovers." exit 0 fi else -- 2.1.4