Your message dated Thu, 30 Apr 2015 11:09:04 +0200
with message-id 
<1430384944.3820872.260699257.306ac...@webmail.messagingengine.com>
and subject line Re: Bug#783782: NSD init script exits silently and 
successfully when daemon binary not found
has caused the Debian Bug report #783782,
regarding NSD init script exits silently and successfully when daemon binary 
not found
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
783782: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783782
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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)
 

--- End Message ---
--- Begin Message ---
Hi Duncan,

I am sorry, but that behaviour is correct. The init.d script should exit
if $DAEMON is not installed, so you don't get a bunch of errors when the
package is removed, but not purged.

For reference see /lib/init/init-d-script (or /etc/init.d/skeleton on
oldstable).

Cheers,
Ondrej

On Thu, Apr 30, 2015, at 03:20, Duncan Bayne wrote:
> 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
> 
> Email had 1 attachment:
> + nsd.init.d.patch
>   1k (text/x-diff)


-- 
Ondřej Surý <[email protected]>
Knot DNS (https://www.knot-dns.cz/) – a high-performance DNS server

--- End Message ---

Reply via email to