[Pkg-nagios-changes] [SCM] debian packaging of icinga(-core) branch, master, updated. debian/1.9.0-1

Alexander Wirt formorer at debian.org
Tue May 7 15:11:07 UTC 2013


The following commit has been merged in the master branch:
commit 51e1d004195b7b05b03dabb8478a61d08bbc3793
Author: Alexander Wirt <formorer at debian.org>
Date:   Tue May 7 14:32:26 2013 +0200

    Improve errorhandling in initscript
    
    Closes: #698139

diff --git a/debian/icinga-common.icinga.init b/debian/icinga-common.icinga.init
index 4a4f6f3..8e4789b 100644
--- a/debian/icinga-common.icinga.init
+++ b/debian/icinga-common.icinga.init
@@ -86,13 +86,18 @@ check_started () {
 #	this a nice generalized way to get requested settings.
 #
 get_config () {
+  CFG=$ICINGACFG
+  test "$2" && CFG="$2"
   if [ "$2" ]; then
     set -- `grep ^$1 $2 | sed 's@=@ @'`
   else
     set -- `grep ^$1 $ICINGACFG | sed 's@=@ @'`
   fi
-  shift
-  echo $*
+  if [ -n "$1" ]
+  then
+      shift
+      echo $*
+  fi
 }
 
 check_config () {
diff --git a/debian/icinga-common.postinst b/debian/icinga-common.postinst
index 046a173..2ff63e9 100644
--- a/debian/icinga-common.postinst
+++ b/debian/icinga-common.postinst
@@ -118,4 +118,11 @@ case "$1" in
     ;;
 esac
 
+init_failed ()
+{
+    echo "Icinga was unable to start due to configuration errors.";
+    echo "Please fix them and manually restart the icinga daemon using";
+    echo " ´service start icinga´";
+}
+
 #DEBHELPER#
diff --git a/debian/rules b/debian/rules
index 97ef46e..8483129 100755
--- a/debian/rules
+++ b/debian/rules
@@ -175,8 +175,8 @@ install-stamp: build-stamp fix-configs-stamp
 	dh_installexamples
 	dh_installlogrotate
 	dh_installchangelogs -i
-	dh_installinit 	     --name icinga -- defaults 30 18
-	dh_installinit	  -n -picinga-idoutils --name ido2db -- defaults 35 20
+	dh_installinit 	     --name icinga --error-handler=init_failed
+	dh_installinit	  -n -picinga-idoutils --name ido2db
 	chmod 755 ${b}/icinga-common/var/lib/icinga 
 	# the real version is in -cgi 
 	rm ${b}/icinga-common/etc/icinga/cgi.cfg

-- 
debian packaging of icinga(-core)



More information about the Pkg-nagios-changes mailing list