current irqblance init.d script doesn't stop daemon
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/
"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.
--- /home/dev-
+++ /home/dev-
@@ -33,10 +33,19 @@
case "$1" in
start)
echo -n "Starting $DESC: "
+
+ if pidof $PNAME >/dev/null
+ then
+ echo "Already running."
+ exit 0
+ fi
+
- --name $PNAME --oknodo --startas $DAEMON \
+ --name $PNAME --oknodo --startas $DAEMON \
-- $OPTIONS $DOPTIONS
-
+
+ pidof $PNAME > $PIDFILE
+
echo "$NAME."
;;
stop)
@@ -44,7 +53,12 @@
- echo "$NAME."
+ if [ -e "$PIDFILE" ]
+ then
+ rm $PIDFILE
+ echo "$NAME."
+ fi
+
;;
restart|
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
+ ;;
*)
- echo "Usage: $N {start|
+ echo "Usage: $N {start|
exit 1
;;
+
esac
exit 0
Changed in irqbalance: | |
status: | Unknown → New |
Changed in irqbalance: | |
status: | Unknown → Fix Released |
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.