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)