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

Alexander Wirt formorer at debian.org
Tue May 29 21:44:39 UTC 2012


The following commit has been merged in the master branch:
commit f3651857874c80fc059ca2fbd19a053c21de0612
Author: Alexander Wirt <formorer at debian.org>
Date:   Tue May 29 23:33:18 2012 +0200

    make icinga-core.postinst a little bit nicer and more verbose

diff --git a/debian/icinga-core.postinst b/debian/icinga-core.postinst
index dcc6268..7813f33 100644
--- a/debian/icinga-core.postinst
+++ b/debian/icinga-core.postinst
@@ -1,21 +1,53 @@
 #!/bin/sh -e
 
-if [ -e "/var/lib/icinga/retention.dat" ]
-then
-    echo "Move old retention.dat to new location (/var/cache/icinga/)"
-    mv /var/lib/icinga/retention.dat /var/cach/icinga/retention.dat
-fi
-
-#if we stop icinga in icinga.prerm we should also start it here..
-if [ -x "/etc/init.d/icinga" ]; then
-	if ! /etc/init.d/icinga status >/dev/null; then
-
-		if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-			invoke-rc.d icinga start || true
-		else
-			/etc/init.d/icinga start || true
-		fi
-	fi
-fi
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+    configure)
+        if [ -e "/var/lib/icinga/retention.dat" ]
+        then
+            echo "Move old retention.dat to new location (/var/cache/icinga/)"
+            mv /var/lib/icinga/retention.dat /var/cach/icinga/retention.dat
+        fi
+
+        #if we stop icinga in icinga.prerm we should also start it here..
+        if [ -x "/etc/init.d/icinga" ]; then
+            if ! /etc/init.d/icinga status >/dev/null; then
+
+                if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                    invoke-rc.d icinga start || true
+                else
+                    /etc/init.d/icinga start || true
+                fi
+            fi
+        fi
+
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
 
 #DEBHELPER#

-- 
debian packaging of icinga(-core)



More information about the Pkg-nagios-changes mailing list