Bug#448524: Sorry, bad patch
severity 448524 serious
A package that fails to upgrade because the service is stopped is a
policy violation, thus serious.
* era eriksson <email@example.com> [2009-08-12 12:59:32 CEST]:
> Ouch, I was too quick -- apologies. The patch I attached to the
> previous message did not properly implement the fix I described. Here's
> another attempt.
There is another issue with the patch (or the init.d script in the
first place): The existence of $PIDFILE is assumed, which is a bad
assumption if one has set their rc links to stop and only starts the
server when needed.
Why not directly using ps "$(cat $PIDFILE)" instead of fiddling around
with grepping through complete ps output? Much more straight forward and
--- thttpd-current/debian/thttpd.init.d.orig 2009-08-12 13:52:08.000000000 +0300
+++ thttpd-current/debian/thttpd.init.d 2009-08-12 13:54:32.000000000 +0300
@@ -36,7 +36,7 @@
echo -n "Stopping $DESC: "
- if ps ax | grep "$(cat $PIDFILE)" | grep -qv grep
+ if test -s $PIDFILE && ps "$(cat $PIDFILE)"
start-stop-daemon -K -q -p $PIDFILE -x $DAEMON --signal 10
This should catch it all.