current irqblance init.d script doesn't stop daemon

Bug #125926 reported by Roberto Rosario
4
Affects Status Importance Assigned to Milestone
irqbalance (Debian)
Fix Released
Unknown
irqbalance (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: irqbalance

the current script fails to create the /var/run/irqbalance.pid file and executing /etc/init.d/irqbalance stop always returns:
"Stopping SMP IRQ Balancer: No irqbalance found running; none killed."
even when irqbalance is indeed running.

This patch strengthens the logic and adds the status option, apply against /etc/init.d/irqbalance.

--- /home/dev-home/irqbalance-old 2007-07-14 01:01:41.000000000 -0400
+++ /home/dev-home/irqbalance 2007-07-14 01:01:27.000000000 -0400
@@ -33,10 +33,19 @@
 case "$1" in
   start)
         echo -n "Starting $DESC: "
+
+ if pidof $PNAME >/dev/null
+ then
+ echo "Already running."
+ exit 0
+ fi
+
         start-stop-daemon --start --pidfile $PIDFILE \
- --name $PNAME --oknodo --startas $DAEMON \
+ --name $PNAME --oknodo --startas $DAEMON \
             -- $OPTIONS $DOPTIONS
-
+
+ pidof $PNAME > $PIDFILE
+
         echo "$NAME."
         ;;
   stop)
@@ -44,7 +53,12 @@

         start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME --oknodo

- echo "$NAME."
+ if [ -e "$PIDFILE" ]
+ then
+ rm $PIDFILE
+ echo "$NAME."
+ fi
+
         ;;
   restart|force-reload)
         echo -n "Restarting $DESC: "
@@ -56,11 +70,22 @@

         echo "$NAME."
         ;;
+ status)
+ if pidof $PNAME >/dev/null
+ then
+ echo "$DESC running."
+ exit 0
+ else
+ echo "$DESC not running."
+ exit 3
+ fi
+ ;;
   *)
         N=/etc/init.d/$SNAME
- echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
         exit 1
         ;;
+
 esac

 exit 0

Revision history for this message
Ritesh Raj Sarraf (rrs) wrote :

I'm seeing a different behavior.

When I do a stop, it does complain that:
"Stopping SMP IRQ Balancer: No irqbalance found running; none killed."

But that is being reported correct.

The process gets dead silently withing a couple of seconds.

Revision history for this message
Ritesh Raj Sarraf (rrs) wrote :

You can close this bug also with the same resolution as mentioned in the debbug.

Changed in irqbalance:
status: Unknown → New
Changed in irqbalance:
status: Unknown → Fix Released
Revision history for this message
Steve Kowalik (stevenk) wrote :

Doing so.

"It didn't die. It only rebalances once for a single socket, multi-core system."

Changed in irqbalance:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.