#638884 init script fails to stop old daemon

Package:
bitlbee
Source:
bitlbee
Description:
IRC to other chat networks gateway (default version)
Submitter:
Joey Hess
Date:
2011-11-25 07:51:09 UTC
Severity:
normal
#638884#5
Date:
2011-08-22 17:22:21 UTC
From:
To:
I upgraded from 3.0.1, and had 2 separate bitlbee processes running.
The init script failed to stop the old, and started a new.

This happens because of the way start-stop-daemon is used.

        start-stop-daemon --start --quiet --pidfile $PIDFILE \
                --exec $DAEMON -- -p $BITLBEE_PORT -P $PIDFILE $BITLBEE_OPTS

         -x, --exec executable
                Check  for  processes  that  are instances of this
                executable (according to /proc/pid/exe).

Since your prerm does not stop bitlbee on upgrade, by the time the
postinst tries to restart it, the executable has been replaced, and
start-stop-daemon cannot stop it.

To fix, you should instead of using --exec ,
use --pidfile /var/run/bitlbee.pid

(I have the default BITLBEE_UPGRADE_DONT_RESTART=0 setting)

#638884#10
Date:
2011-11-25 07:38:45 UTC
From:
To:
I was going to fix this, but:

#
#       Function that stops the daemon/service.
#
d_stop() {
         start-stop-daemon --stop --quiet --pidfile $PIDFILE \
                 --name $NAME
}

Actually it already doesn't use --exec ..

Could the PIDfile be broken somehow?


Wilmer.