-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Thomas Hood wrote:
> Package: pdns-recursor
> Version: 2.9.17-10
> Severity: normal
> Tags: patch
> 
> First I report some problems, then I suggest a solution.  :)
> 
> * On stop, resolvconf is told to delete the resolvconf record after the
> daemon is stopped.  It would be better to do this before the daemon is
> stopped so that no new queries are sent to the daemon just when it is
> about to be killed.
> 
That's a good point. Next time i'll investigate that stuff better.

> * The record should be called 'lo.pdns-recursor' so that it does not
> conflict with records created by other nameservers which could
> conceivably by running on the same machine.  (pdns-recursor does not
> Conflict with any other packages, so I infer that this is possible.
> Anyway, there is no reason not to give the record a unique name.)
> 
Agreed.

> * Currently in the stop method the initscript sends a signal and then
> exits immediately and unconditionally.  However, the script should not
> exit before the daemon has really stopped.  More precisely, it should
> not exit before the daemon releases resources that could be needed by
> other daemons that are starting in the same runlevel change or dpkg run.
> Furthermore, if the daemon could not be stopped then the script should
> exit with an error status.  (Admittedly, many initscripts in Debian
> have this shortcoming.)
> 
Agreed.

No problem, it seems that people are using the package and how more
problems getting solved how better :)

> * On restart, a "sleep 3" is used to ensure that the daemon is restarted
> after it is stopped.  This either wastes time or is unreliable.  For
> the same reason, the previous problem isn't best solved by adding a
> sleep to the end of the stop method.
> 
What do you mean exactly, now we wait for 3 seconds and then try to
start. (Assuming that it is stopped after 3 seconds.)

Checked your pdns-recursor script and i like it.

> * The script does "test -x $DAEMON" runs the daemon using $NAME, which
> is inconsistent.
> 
Agreed.

> * The daemon is started using the command
> 
>     $NAME --daemon 2>&1 /dev/null
> 
> As the daemon does not take any non-option arguments (according to the
> man page), I infer that you really meant to do:
> 
>     $NAME --daemon 2>&1 >/dev/null
> 
> However, I don't see why you want to hide the daemon's rather brief
> startup message.
> 
> [EMAIL PROTECTED]:~$ sudo /usr/sbin/pdns_recursor --daemon
> Apr 16 18:53:50 Incoming query source port: 53
> Apr 16 18:53:50 Done priming cache with root hints
> 
> The cost is great: you also hide the daemon's error messages, if any.
> If the startup messages are superfluous then the daemon source should
> be patched in order to suppress them.
> 
That means patching of the sources. I don't know if we can get it
working but we will try to fix that. In first instance we show the
messages when the init script will run.

> * Neither the daemon nor the initscript deletes the pidfile on stop.
> 
hmm..

> 
> * Solution
> 
> I wrote the initscripts for dnsmasq and pdnsd which, although possibly
> imperfect, are less imperfect.  Each uses start-stop-daemon to test for
> running instances of the daemon, properly handles various failure cases
> and interfaces with resolvconf correctly.  I attach an initscript like
> theirs for pdns-recursor.
> 
> I have implemented the "Don't really start unless a certain environment
> variable is set to a certain value" feature even though I don't like it
> when maintainers try to undermine the standard mechanism for enabling
> and disabling services in runlevels.  :/
> 
> If you find any problems with the initscript then please discuss them
> with me.  If the problem turns out to be real then I would like to fix
> any similar problems in the dnsmasq and/or pdnsd initscripts.
> 
> The following log shows that the initscript works.  The daemon does
> produce ugly messages, but as I said earlier, these should be dealt
> with in the daemon source.  One possibility would be to change the
> daemon to print them on standard output rather than on standard
> error and then divert only standard output to /dev/null.  This would
> eliminate the unwanted startup messages without hiding error messages.
> 
> # # Note that in the following case START is unset
> # ./pdns-recursor start
> Not starting PowerDNS recursor -- disabled.
> # START=yes ./pdns-recursor start
> Starting PowerDNS recursor: pdns_recursorApr 16 19:26:55 Incoming query
> source port: 53
> Apr 16 19:26:55 Done priming cache with root hints
> .
> # START=yes ./pdns-recursor start
> Starting PowerDNS recursor: pdns_recursor (already running).
> # ./pdns-recursor stop
> Stopping PowerDNS recursor: pdns_recursor.
> # ./pdns-recursor stop
> Stopping PowerDNS recursor: pdns_recursor (not running).
> # START=yes ./pdns-recursor restart
> Restarting PowerDNS recursor: pdns_recursorApr 16 19:27:19 Incoming
> query source port: 53
> Apr 16 19:27:19 Done priming cache with root hints
> .
> # START=yes ./pdns-recursor restart
> Restarting PowerDNS recursor: pdns_recursorApr 16 19:27:21 Incoming
> query source port: 53
> Apr 16 19:27:21 Done priming cache with root hints
> .
> # # Note that in the following cases START is unset
> # ./pdns-recursor restart
> Stopping PowerDNS recursor: pdns_recursor.
> # ./pdns-recursor restart
> Stopping PowerDNS recursor: pdns_recursor (not running).
> 
> 
Very good.

I like the way how you solved it, and i'll try to fix those problems
also in pdns-server.

One thing: Probably you can file a bug against the package initscripts
and ask them to provide a better skeleton script. I have taken the
skeleton script for pdns-recursor to make a new initscript. But yours
seems much better. Also i think we need something about this in the
debian-policy. So that we have good initscripts in debian.

And at last maybe a bugreport against lintian/linda to check for this
kind of changes if possible.

Thanks for reporting and providing a solution.

Regards,

PowerDNS maintainers.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCYV9h2n1ROIkXqbARAiuTAJ4h72UqtLEuOJQatV3PMdAdeMxdRQCggEBQ
QPbehVazJ9E1SsH61SHe+g0=
=5pNU
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to