Here is the patch used for NMU.
Ondrej.
--
Ondřej Surý <[email protected]>
diff -urNap unbound-1.0.2/debian/changelog unbound-1.0.2~nmu/debian/changelog
--- unbound-1.0.2/debian/changelog 2008-12-15 19:59:32.000000000 +0100
+++ unbound-1.0.2~nmu/debian/changelog 2008-12-15 19:55:08.000000000 +0100
@@ -1,3 +1,18 @@
+unbound (1.0.2-1.1) unstable; urgency=low
+
+ [ Hideki Yamane (Debian-JP) ]
+ * debian/{unbound.init,unbound.default}
+ + set not start by default, to avoid that port 53 blocking by other name
+ servers will cause install problems
+ * debian/unbound.prerm
+ + fix lintian "unbound: maintainer-script-hides-init-failure prerm:5" error
+
+ [ OndÅej Surý ]
+ * Non-maintainer upload.
+ * Minor tweaks to patched init.d file to make it work.
+
+ -- OndÅej Surý <[email protected]> Mon, 15 Dec 2008 19:54:44 +0100
+
unbound (1.0.2-1) unstable; urgency=low
* New upstream release;
diff -urNap unbound-1.0.2/debian/unbound.default unbound-1.0.2~nmu/debian/unbound.default
--- unbound-1.0.2/debian/unbound.default 2008-12-15 19:59:32.000000000 +0100
+++ unbound-1.0.2~nmu/debian/unbound.default 2008-12-15 11:44:41.000000000 +0100
@@ -1,3 +1,11 @@
+# Do you want to start unbound?
+# only allowed values are "true" and "false".
+# if you already use other DNS server, they would listen port 53,
+# so unbound fails to start. Please adjust, then set "true".
+
+UNBOUND_ENABLE=false
+
+
# config file path
#DAEMON_OPTS="-c /etc/unbound/unbound.conf"
diff -urNap unbound-1.0.2/debian/unbound.init unbound-1.0.2~nmu/debian/unbound.init
--- unbound-1.0.2/debian/unbound.init 2008-12-15 19:59:32.000000000 +0100
+++ unbound-1.0.2~nmu/debian/unbound.init 2008-12-15 19:54:37.000000000 +0100
@@ -1,6 +1,28 @@
#!/bin/sh
+### BEGIN INIT INFO
+# Provides: unbound
+# Required-Start: $network $remote_fs $syslog
+# Required-Stop: $network $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: validating, recursive, caching DNS resolver
+# Description: Unbound is a recursive-only caching DNS server which can
+# optionally perform DNSSEC validation of results. It
+# implements only a minimum amount of authoritative service
+# to prevent leakage to the root nameservers: forward lookups
+# for localhost, reverse for 127.0.0.1 and ::1, and NXDOMAIN
+# for zones served by AS112. Stub and forward zones are
+# supported.
+# Unbound implements a number of security features, including
+# chrooting and privilege dropping. The Debian init script
+# will populate a chroot by default.
+#
+### END INIT INFO
+
+
NAME=unbound
+UNBOUND_ENABLE=false
DESC="recursive DNS server"
DAEMON=/usr/sbin/unbound
CHROOT_DIR=/var/lib/unbound
@@ -10,7 +32,18 @@ test -x $DAEMON || exit 0
. /lib/lsb/init-functions
-test -f /etc/default/$NAME && . /etc/default/$NAME
+if [ -f /etc/default/$NAME ]; then
+ . /etc/default/$NAME
+ case "x$UNBOUND_ENABLE" in
+ xtrue|xfalse) ;;
+ *) log_failure_msg \
+ "Value of UNBOUND_ENABLE in /etc/default/$NAME must be either 'true' or 'false';"
+ log_failure_msg \
+ "not starting unbound daemon."
+ exit 1;
+ ;;
+ esac
+fi
install_chroot() {
if [ "$CHROOT" != "no" ]; then
@@ -40,14 +73,20 @@ daemon_stopped() {
case "$1" in
start)
- log_daemon_msg "Starting $DESC" "$NAME"
- if daemon_stopped; then
- install_chroot
- fi
- if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then
- log_end_msg 0
+ if "$UNBOUND_ENABLE"; then
+ log_daemon_msg "Starting $DESC" "$NAME"
+ if daemon_stopped; then
+ install_chroot
+ fi
+ if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE \
+ --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
else
- log_end_msg 1
+ log_warning_msg \
+ "$NAME daemon is not enabled in /etc/default/$NAME, not starting..."
fi
;;
@@ -61,14 +100,19 @@ case "$1" in
;;
restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --retry 5
- uninstall_chroot
- install_chroot
- if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then
- log_end_msg 0
- else
- log_end_msg 1
+ set +e
+
+ if $UNBOUND_ENABLE; then
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --retry 5
+ uninstall_chroot
+ install_chroot
+ if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE \
+ --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
fi
;;
@@ -79,10 +123,5 @@ case "$1" in
;;
esac
-### BEGIN INIT INFO
-# Provides: unbound
-# Required-Start: $network $remote_fs $syslog
-# Required-Stop: $network $remote_fs $syslog
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-### END INIT INFO
+exit 0;
+
diff -urNap unbound-1.0.2/debian/unbound.prerm unbound-1.0.2~nmu/debian/unbound.prerm
--- unbound-1.0.2/debian/unbound.prerm 2008-12-15 19:59:32.000000000 +0100
+++ unbound-1.0.2~nmu/debian/unbound.prerm 2008-12-15 11:44:41.000000000 +0100
@@ -2,8 +2,8 @@
set -e
if [ -x "/etc/init.d/unbound" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d unbound stop || exit 0
+ invoke-rc.d unbound stop
else
- /etc/init.d/unbound stop || exit 0
+ /etc/init.d/unbound stop
fi
fi