Package: openntpd
Version: 20080406p-10
Severity: normal
Tags: patch

Dear Maintainer,

Currently, openntpd's init script restarts openntpd by killing it (with
start-stop-daemon --stop), sleeping 1 second, and then starting it.
This has a race condition: if openntpd takes longer than 1 second to
terminate, it fails to start up again (presumably because the UDP port
is in use).  This has happened to me a few times now.

The attached patch adds the --retry option to the start-stop-daemon
command, so that start-stop-daemon waits for the daemon to terminate,
sending SIGKILL if necessary.

Could this patch be applied to the package?

Thanks,
Andrew
diff -ruN openntpd-20080406p.orig/debian/openntpd.init openntpd-20080406p/debian/openntpd.init
--- openntpd-20080406p.orig/debian/openntpd.init	2014-07-31 13:20:18.000000000 -0700
+++ openntpd-20080406p/debian/openntpd.init	2014-12-19 17:39:57.730697444 -0800
@@ -45,14 +45,13 @@
 
 	stop)
 		echo -n "Stopping $DESC: "
-		start-stop-daemon --stop --oknodo --quiet --user root --exec $DAEMON
+		start-stop-daemon --stop --oknodo --quiet --retry=TERM/30/KILL/5 --user root --exec $DAEMON
 		echo "$NAME."
 		;;
 
 	restart|force-reload)
 		echo -n "Restarting $DESC: "
-		start-stop-daemon --stop --oknodo --quiet --user root --exec $DAEMON
-		sleep 1
+		start-stop-daemon --stop --oknodo --quiet --retry=TERM/30/KILL/5 --user root --exec $DAEMON
 		start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS
 		echo "$NAME."
 		;;

Reply via email to