This plugin is shipped in unbound in stretch, which causes a bunch of
issues.
Eventually, we should remove the plugin (and the divert) from here.
-munin-plugins-local (0.10~test.3) UNRELEASED; urgency=medium
+munin-plugins-local (0.10~test.4) UNRELEASED; urgency=medium
* Add lvmcache_ plugin, for graphing lvm cache state
+ * Add prerm and postinst to handle duplication of unbound_munin_ (also
+ provided by unbound in stretch). Eventually we should move to that
+ plugin, but not until we're on stretch everywhere.
-- Michael Howe <michael@michaelhowe.org> Sat, 16 Dec 2017 22:12:26 +0000
--- /dev/null
+#!/bin/sh
+
+set -e
+
+if [ "$1" = configure ]; then
+ DEBIAN_VERSION=$(sed -e 's/\..*//' /etc/debian_version)
+ if [ $DEBIAN_VERSION -gt 8 ]; then
+ # for stretch and above unbound includes the unbound_munin plugin itself
+ dpkg-divert --add --package munin-plugins-local --rename --divert /usr/share/munin/plugins/unbound_munin_.distrib /usr/share/munin/plugins/unbound_munin_
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/sh
+
+set -e
+
+if [ "$1" = remove ]; then
+ DEBIAN_VERSION=$(sed -e 's/\..*//' /etc/debian_version)
+ if [ $DEBIAN_VERSION -gt 8 ]; then
+ # for stretch and above unbound includes the unbound_munin plugin itself
+ dpkg-divert --remove --package munin-plugins-local --rename --divert /usr/share/munin/plugins/unbound_munin_.distrib /usr/share/munin/plugins/unbound_munin_
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0