I have found that the following patch works better.  It avoids slow-to-stop 
ntpd child processes messing the whole thing up, especially during a restart.
diff -u ntp-4.2.0a+stable/debian/ntp-server.init.d ntp-4.2.0a+stable/debian/ntp-server.init.d
--- ntp-4.2.0a+stable/debian/ntp-server.init.d
+++ ntp-4.2.0a+stable/debian/ntp-server.init.d
@@ -15,20 +15,20 @@
 case "$1" in
 	start)
 		echo -n "Starting NTP server: ntpd"
-  		start-stop-daemon --start --quiet --pidfile /var/run/ntpd.pid --exec /usr/sbin/ntpd -- -p /var/run/ntpd.pid -u $UGID
+  		start-stop-daemon --start --quiet --oknodo --pidfile /var/run/ntpd.pid --exec /usr/sbin/ntpd -- -p /var/run/ntpd.pid -u $UGID
 		echo "."
   		;;
 	stop)
 		echo -n "Stopping NTP server: ntpd"
-  		start-stop-daemon --stop --quiet --pidfile /var/run/ntpd.pid
+  		start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/ntpd --retry 60
 		echo "."
 		rm -f /var/run/ntpd.pid
   		;;
 	restart|force-reload)
 		echo -n "Restarting NTP server: ntpd... "
-  		start-stop-daemon --stop --quiet --pidfile /var/run/ntpd.pid
+  		start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/ntpd --retry 60
   		sleep 2
-  		start-stop-daemon --start --quiet --exec /usr/sbin/ntpd -- -p /var/run/ntpd.pid -u $UGID
+  		start-stop-daemon --start --quiet --oknodo --pidfile /var/run/ntpd.pid --exec /usr/sbin/ntpd -- -p /var/run/ntpd.pid -u $UGID
 		echo "done."
   		;;
 	reload)

Reply via email to