sleep n is a nasty way to paper over a race and will always break in
some situation somewhere. Better to remove the race entirely:

--- /home/joey/rc.klogd 2006-01-09 23:15:11.000000000 -0500
+++ rc.klogd    2006-01-09 23:16:23.000000000 -0500
@@ -55,13 +55,12 @@
     ;;
   stop)
     echo -n "Stopping kernel log daemon: klogd"
-    start-stop-daemon --stop --quiet --exec $binpath --pidfile $pidfile
+    start-stop-daemon --stop --retry TERM/1/TERM/1/TERM/4/KILL --quiet --exec 
$binpath --pidfile $pidfile
     echo "."
     ;;
   restart|force-reload)
     echo -n "Restarting kernel log daemon: klogd"
-    start-stop-daemon --stop --quiet --exec $binpath --pidfile $pidfile
-    sleep 1
+    start-stop-daemon --stop --retry TERM/1/TERM/1/TERM/4/KILL --quiet --exec 
$binpath --pidfile $pidfile
     start-stop-daemon --start --quiet --exec $binpath -- $KLOGD
     echo "."
     ;;

I wonder if syslogd has the same race?

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature

Reply via email to