On Wed, Mar 01, 2006 at 12:09:08PM +0000, Andrew Glen-Young wrote: > On running the init script with the 'stop' argument the script returns an > error: > # /etc/init.d/openntpd stop > Stopping openntpd: start-stop-daemon: warning: failed to kill 759: No > such process > ntpd. > > This also seems to affect later versions. I can't confirm this, but I > have looked through the Debian patches in 'unstable' and 'testing' and > they both seem to have the same problem. > > SOLUTION: > > I modified the init script to create a pidfile in the > /var/run/openntpd directory (which is created on install).
That directory is supposed to be an empty directory. Nothing should be put in it. If you're going to create pid files, please just put in it /var/run/. Anyway, the problem is that there are 2 processes running, and start-stop-daemon tries to kill them both. This is how a strace looks: [pid 9136] 20:50:03.208773 kill(9130, SIGTERM) = 0 [pid 9136] 20:50:03.209378 kill(9129, SIGTERM) = -1 ESRCH (No such process) Doing the same with kill: 20:52:55.346234 kill(9168, SIGTERM) = 0 20:52:55.346899 kill(9167, SIGTERM) = -1 ESRCH (No such process) kill just doesn't complain about it. I agree it's an annoyance, you might think it didn't get stopped while it did. Also, it's just a warning, the script behaves like it is killed. Anyway, you could agrue that it's a bug in start-stop-daemon that it shouldn't give that warning in case you use the --quiet option, since it says it will only print error messages in that case. > Modified line 30 to read: > start-stop-daemon --start --quiet --make-pidfile > --pidfile=/var/run/openntpd/ntpd.pid --exec $DAEMON -- $DAEMON_OPTS Have you actually tried that? The pid file generated actually has the wrong pid in it. The problem is that ntpd does an other fork(), so your pid is ussually off by 1. (The manpage actually warns about this.) Also, you need to use the same pidfile when you stop it, or creating the pid file doesn't help at all. And if you do that, it doesn't get killed at all, since it has the wrong pid in it. Anyway, it seems you only get the message some times. Atleast, trying this alot of times, I only get it a few times. Which might appear as that your patch worked, while it actually didn't change a thing. The proper way to fix this would be to have ntpd create it's own pid file, and then use that when using --stop. Kurt -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

