tags 497959 + confirmed patch 
thanks

Please find attached some suggestions to cleanly purge bind while
removed (prerm + postrm).

-- 

Guillaume Delacour
diff -urN bind9-9.5.1.dfsg.P2/debian/bind9.postrm bind9-9.5.1.dfsg.P2.gui/debian/bind9.postrm
--- bind9-9.5.1.dfsg.P2/debian/bind9.postrm	2009-04-15 12:16:27.000000000 +0000
+++ bind9-9.5.1.dfsg.P2.gui/debian/bind9.postrm	2009-04-15 12:15:32.000000000 +0000
@@ -5,6 +5,13 @@
 	rm -f /etc/bind/rndc.key /etc/default/bind9
 	rmdir /etc/bind >/dev/null 2>&1 || true
         rm -f /etc/apparmor.d/force-complain/usr.sbin.named >/dev/null 2>&1 || true
+	rm -rf /var/lib/bind
+        # delete bind daemon user
+        # test if exists just to don't generate error
+        if getent passwd bind > /dev/null ; then
+         echo "Deleting bind user"
+         deluser  --quiet bind > /dev/null || true
+        fi
 fi
 
 #DEBHELPER#
diff -urN bind9-9.5.1.dfsg.P2/debian/bind9.prerm bind9-9.5.1.dfsg.P2.gui/debian/bind9.prerm
--- bind9-9.5.1.dfsg.P2/debian/bind9.prerm	1970-01-01 00:00:00.000000000 +0000
+++ bind9-9.5.1.dfsg.P2.gui/debian/bind9.prerm	2009-04-15 12:29:48.000000000 +0000
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+    remove|upgrade)
+        # if bind is running, stop it before removing
+        if pidof named >/dev/null 2>&1; then
+                # test if invoke-rc.d command is present on this system
+                if command -v invoke-rc.d >/dev/null 2>&1; then
+                    invoke-rc.d bind9 stop
+                # if really not, use initscript
+                else
+                    /etc/init.d/bind9 stop
+                fi
+        fi
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0

Attachment: signature.asc
Description: PGP signature

Reply via email to