daemon-util: pass --oknodo at rotate_logs
authorApollon Oikonomopoulos <apoikos@gmail.com>
Wed, 24 Jul 2013 06:22:00 +0000 (09:22 +0300)
committerGuido Trotter <ultrotter@google.com>
Wed, 24 Jul 2013 07:48:31 +0000 (09:48 +0200)
daemon-util's rotate_logs() did not pass --oknodo to start-stop-daemon while
HUPing the daemon processes. As a result, rotate_logs would fail for a
non-running daemon causing rotate_all_logs to exit prematurely.

We can fix this by either passing --oknodo to start-stop-daemon, or have
rotate_all_logs ignore any errors. The former is probably a safer approach - as
it doesn't mask any potential coding errors in rotate_logs - and is also
semantically correct (we only care about log rotation if a daemon is actually
running).

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

daemons/daemon-util.in

index 2be14e9..848a122 100644 (file)
@@ -324,7 +324,7 @@ rotate_logs() {
 
   if type -p start-stop-daemon >/dev/null; then
     start-stop-daemon --stop --signal HUP --quiet \
-      --pidfile $pidfile
+      --oknodo --pidfile $pidfile
   else
     _ignore_error killproc \
       -p $pidfile \