[Pkg-nagios-changes] [SCM] Debian packaging of icinga-web branch, master, updated. debian/1.7.1-1-3-g2e51e4f

Markus Frosch markus at lazyfrosch.de
Tue Jun 26 08:02:08 UTC 2012


The following commit has been merged in the master branch:
commit 3a64851fefdb090cda09c7e113609d6e30156ae6
Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Tue Jun 26 08:42:47 2012 +0200

    updated postinst to avoid breaking due to errors

diff --git a/debian/icinga-web.postinst b/debian/icinga-web.postinst
index 6ac2598..c66f666 100644
--- a/debian/icinga-web.postinst
+++ b/debian/icinga-web.postinst
@@ -26,13 +26,13 @@ generate_dbxml() {
         source $dbconfig
     else
         echo "database config failed: file $dbconfig does not exist" >&2
-        return 1
+        return
     fi
 
     # leave when dbconfig not enabled
     if [ "$dbc_install" != "true" ]; then
         echo "database config failed: dbconfig-common for \"$(basename $dbconfig .conf)\" not enabled!" 
-        return 1
+        return
     fi
 
     # create tempfile
@@ -110,6 +110,12 @@ fi
 setpassword() {
     password="$1"
     
+    # load database connection info
+    if [ ! -f /etc/dbconfig-common/icinga-web.conf ]; then
+        return
+    fi
+    source /etc/dbconfig-common/icinga-web.conf
+
     # gen new salt
     salt=$(php5 -r 'echo hash("sha256", uniqid("root_", mt_rand()));')
     
@@ -118,9 +124,6 @@ setpassword() {
     export PW="$password"
     pwhash=$(php5 -r 'echo hash_hmac("sha256", getenv("PW"), getenv("SALT"));')
 
-    # load database connection info
-    source /etc/dbconfig-common/icinga-web.conf
-
     if [ "$dbc_dbtype" = "mysql" ]; then
         # query the database to update
         salt_e=${salt/\'/\\\'}
@@ -177,8 +180,12 @@ setperm() {
 setperm root www-data 0640 /etc/icinga-web/conf.d/access.xml
 setperm root www-data 0640 /etc/icinga-web/conf.d/auth.xml
 setperm root www-data 0640 /etc/icinga-web/conf.d/databases.xml
-setperm root www-data 0640 /etc/icinga-web/conf.d/database-web.xml
-setperm root www-data 0640 /etc/icinga-web/conf.d/database-ido.xml
+if [ -f /etc/icinga-web/conf.d/database-web.xml ]; then
+    setperm root www-data 0640 /etc/icinga-web/conf.d/database-web.xml
+fi
+if [ -f /etc/icinga-web/conf.d/database-ido.xml ]; then
+    setperm root www-data 0640 /etc/icinga-web/conf.d/database-ido.xml
+fi
 setperm root www-data 0640 /etc/icinga-web/conf.d/module_reporting.xml
 
 setperm www-data adm 0770 /var/log/icinga-web

-- 
Debian packaging of icinga-web



More information about the Pkg-nagios-changes mailing list