*Oups*,

Previous patch was the wrong version; sorry about that. Here is the
correct one (v2).

Best regards,

V.
>From dc3df25aa78874c32ada04d0e7861a335b31d3c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <[email protected]>
Date: Tue, 5 Jun 2012 23:02:26 +0200
Subject: [PATCH] Fix return code for start and restart (v2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix start/restart init script return codes. Avoid that pidofproc reads from the
same file where it is redirected.

Signed-off-by: Vincent Stehlé <[email protected]>
---
 debian/irqbalance.init |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/irqbalance.init b/debian/irqbalance.init
index 4fd8c08..fe32d12 100644
--- a/debian/irqbalance.init
+++ b/debian/irqbalance.init
@@ -51,7 +51,7 @@ case "$1" in
         fi
 
         start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $OPTIONS $DOPTIONS
-        pidofproc $PNAME > $PIDFILE
+        pid=$( pidofproc $PNAME ) && echo $pid >$PIDFILE
 
         log_end_msg $?
         ;;
@@ -70,7 +70,7 @@ case "$1" in
         rm -f $PIDFILE
 
         start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $OPTIONS $DOPTIONS
-        pidofproc $PNAME > $PIDFILE
+        pid=$( pidofproc $PNAME ) && echo $pid >$PIDFILE
 
         log_end_msg $?
         ;;
-- 
1.7.10

Reply via email to