Package: openntpd
Version: 3.9p1+debian-5
Severity: normal
Tags: patch

The start-stop-daemon command in the init script tries to stop both ntpd
processes, but usually only succeeds in killing one, since killing the
first one causes it to kill the second. Then the start-stop-daemon fails
to kill the second ntpd process and prints an error.

The attached patch changes the start-stop-daemon to only select the
process owned by root, which prevents it from trying to kill both
processes and therefore the error.

Before and after the patch:

 # /etc/init.d/openntpd stop
 Stopping openntpd: start-stop-daemon: warning: failed to kill 10309: No such 
process
 ntpd.
 # /etc/init.d/openntpd start
 Starting openntpd: ntpd.
 r...@endor:/home/graham# dpkg -i openntpd_3.9p1+debian-6_i386.deb 
 (Reading database ... 22189 files and directories currently installed.)
 Preparing to replace openntpd 3.9p1+debian-5 (using 
openntpd_3.9p1+debian-6_i386.deb) ...
 Stopping openntpd: start-stop-daemon: warning: failed to kill 10412: No such 
process
 ntpd.
 Unpacking replacement openntpd ...
 Setting up openntpd (3.9p1+debian-6) ...
 Installing new version of config file /etc/init.d/openntpd ...
 Starting openntpd: ntpd.
 Processing triggers for man-db ...
 # /etc/init.d/openntpd stop
 Stopping openntpd: ntpd.
diff -Naur openntpd-3.9p1+debian.orig/debian/changelog openntpd-3.9p1+debian/debian/changelog
--- openntpd-3.9p1+debian.orig/debian/changelog	2010-06-09 04:40:03.000000000 +0000
+++ openntpd-3.9p1+debian/debian/changelog	2010-10-12 03:59:26.009917353 +0000
@@ -1,3 +1,9 @@
+openntpd (3.9p1+debian-6) unstable; urgency=low
+
+  * Change init script to only kill parent ntpd.
+
+ -- Graham Wilson <gra...@mknod.org>  Tue, 12 Oct 2010 03:58:47 +0000
+
 openntpd (3.9p1+debian-5) unstable; urgency=low
 
   * Adding missing dependency on hardening-include.
diff -Naur openntpd-3.9p1+debian.orig/debian/openntpd.init openntpd-3.9p1+debian/debian/openntpd.init
--- openntpd-3.9p1+debian.orig/debian/openntpd.init	2010-06-08 20:59:58.000000000 +0000
+++ openntpd-3.9p1+debian/debian/openntpd.init	2010-10-12 03:59:50.477917433 +0000
@@ -38,13 +38,13 @@
 
 	stop)
 		echo -n "Stopping $DESC: "
-		start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
+		start-stop-daemon --stop --oknodo --quiet --user root --exec $DAEMON
 		echo "$NAME."
 		;;
 
 	restart|force-reload)
 		echo -n "Restarting $DESC: "
-		start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
+		start-stop-daemon --stop --oknodo --quiet --user root --exec $DAEMON
 		sleep 1
 		start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS
 		echo "$NAME."

Reply via email to