Package: nsd
Version: 4.1.0-3

When the NSD init script nsd.init.d can not find the NSD binary in
$DAEMON, it fails silently and exits returning 0 (success).  Here is a 
transcript:

root@ns:/etc/init.d# ./nsd start ; echo $?
0

I've attached a patch that makes the init script return something other
than success, and also to log the failure to stderr.  Here is a
transcript with the patch applied:

root@ns:/etc/init.d# ./nsd start ; echo $?
/etc/init.d/nsd: exiting as unable to find the NSD daemon at /usr/sbin/nsd
2

diff --git a/debian/nsd.init.d b/debian/nsd.init.d
index c96ac99..f65df20 100644
--- a/debian/nsd.init.d
+++ b/debian/nsd.init.d
@@ -22,8 +22,11 @@ SCRIPTNAME=/etc/init.d/nsd
 
 NSDC=/usr/sbin/nsd-control
 
-# Exit if the package is not installed
-[ -x $DAEMON ] || exit 0
+# Exit loudly if the package is not installed
+if [ ! -x $DAEMON ]; then
+    >&2 echo $SCRIPTNAME: exiting as unable to find the NSD daemon at $DAEMON
+    exit 2
+fi
 
 PIDFILE=$(nsd-checkconf -o pidfile $CONFFILE)
 

Reply via email to