Code

Rework package configuration
authortolimar <tolimar@98d490a6-b407-0410-aaaa-fdee166ba3f5>
Mon, 26 Sep 2011 13:24:35 +0000 (13:24 +0000)
committertolimar <tolimar@98d490a6-b407-0410-aaaa-fdee166ba3f5>
Mon, 26 Sep 2011 13:24:35 +0000 (13:24 +0000)
git-svn-id: svn://svn.debian.org/svn/pkg-nagios/nagvis/trunk@1968 98d490a6-b407-0410-aaaa-fdee166ba3f5

debian/changelog
debian/config
debian/postinst
debian/postrm
debian/templates [new file with mode: 0644]

index 747a247875e222cec0c2188850db727c2be9a51f..a58a85671e26f3fe919573d4ff8805687c58a569 100644 (file)
@@ -4,8 +4,9 @@ nagvis (1:1.5.10-1) UNRELEASED; urgency=low
   * Update package description:  Now also works with Icinga
   * Change Package dependencies:  Drop all ndo and mysql related stuff, we want to use mk livestatus
   * Update debian/copyright
+  * Rework post{inst,rm} to not configure database
 
- -- Alexander Reichle-Schmehl <tolimar@debian.org>  Wed, 07 Sep 2011 16:59:51 +0200
+ -- Alexander Reichle-Schmehl <tolimar@debian.org>  Mon, 26 Sep 2011 15:23:50 +0200
 
 nagvis (1:1.4.6-2) unstable; urgency=medium
 
index d405a8b338ea29a2940368c0a5f5ce40ec136615..d3d7ea7ccbe4cc88626ba8c658c0d791189f2dc5 100644 (file)
@@ -3,19 +3,7 @@ set -e
 
 . /usr/share/debconf/confmodule
 
-tmp=`mktemp`
+db_input high nagvis/monitoring_system || true
+db_go || true
 
-if [ -f /etc/dbconfig-common/ndoutils-mysql.conf ] ; then
-       dbconfig-load-include -f sh \
-               -udbc_dbuser -pdbc_dbpass -ddbc_dbname -sdbc_dbserver -Pdbc_dbport \
-               /etc/dbconfig-common/ndoutils-mysql.conf > $tmp
-       . $tmp
-       if [ -f /usr/share/dbconfig-common/dpkg/frontend.config.mysql ]; then
-               . /usr/share/dbconfig-common/dpkg/frontend.config.mysql
-               dbc_go nagvis $@
-       fi
-       db_stop
-fi
-
-rm -f $tmp
 
index 925277a44fd87351bea7fb709317e9a509fa0fae..0a2093cb2106fa59fcd705e1c36f5503e048e42c 100644 (file)
@@ -6,13 +6,6 @@
 set -e
 
 . /usr/share/debconf/confmodule
-if [ -f /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql ]; then
-       . /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql
-       dbc_generate_include='template:/etc/nagvis/nagvis.ini.php'
-       dbc_generate_include_owner='www-data:www-data'
-       dbc_generate_include_args='--ucf -C\; -o template_infile=/usr/share/nagvis/debian/nagvis.ini.php-sample'
-       dbc_go nagvis $@
-fi
 
 # summary of how this script can be called:
 #        * <postinst> `configure' <most-recently-configured-version>
@@ -58,6 +51,9 @@ case "$1" in
        #       ln -s /etc/nagvis/apache.conf /etc/apache2/conf.d/nagvis.conf
        #fi
 
+       monitoring=$(db_get nagvis/monitoring_system)
+       echo "Will configure nagvis to use $monitoring"
+
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
index 1615814198634f270e44fb885ee0c4ed8055c427..f1a107960b6f11b76855339c784a4f02c626e5fa 100644 (file)
@@ -5,54 +5,24 @@
 
 set -e
 
-if [ -f /usr/share/debconf/confmodule ]; then
-       . /usr/share/debconf/confmodule
-fi
-
-if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
-       . /usr/share/dbconfig-common/dpkg/frontend.postrm.mysql
-       dbc_go nagvis $@
-fi
-
-# summary of how this script can be called:
-#        * <postrm> `remove'
-#        * <postrm> `purge'
-#        * <old-postrm> `upgrade' <new-version>
-#        * <new-postrm> `failed-upgrade' <old-version>
-#        * <new-postrm> `abort-install'
-#        * <new-postrm> `abort-install' <old-version>
-#        * <new-postrm> `abort-upgrade' <old-version>
-#        * <disappearer's-postrm> `disappear' <overwriter>
-#          <overwriter-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
 case "$1" in
-    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-
-    *)
-        echo "postrm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-if [ "$1" = "purge" ]; then
+    purge)
        for file in apache.conf nagvis.ini.php; do
                rm -f /etc/nagvis/$file
                if [ -x /usr/bin/ucf ] ; then
                        ucf --debconf-ok --purge /etc/nagvis/$file
                fi
        done
-
-       #if [ -e /etc/apache2/conf.d/nagvis.conf ]; then
-       #       rm -f /etc/apache2/conf.d/nagvis.conf
-       #fi
-
        rm -rf /var/cache/nagvis
-fi
-       
+    ;;
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
 
diff --git a/debian/templates b/debian/templates
new file mode 100644 (file)
index 0000000..13c4d6e
--- /dev/null
@@ -0,0 +1,13 @@
+Template: nagvis/monitoring_system
+Type: select
+Default: icinga
+Choices: icinga, nagios, other
+Description: For which monitoring suite should NagVis be configured?
+ This NagVis package supports the monitoring suites Icinga as well as
+ well as Nagios out of the box.  Choose them, if you have them locally
+ installed and would like to use check-mk-livestatus.
+ .
+ If you would like to use NagVis with a different backend or a different
+ monitoring suite, please choose "other".  You'll have to configure it
+ manually.
+