net-im/bitlbee-3.0.5-r1 When running bitlbee in daemon mode and restarting bitlbee via initscript, it fails to restart with: "start-stop-daemon: /usr/sbin/bitlbee is already running" Bitlbee can fork many processes and start-stop-daemon does not check against pid file, but rather does process name comparsion. Some background: Bitlbee forks process for each connected client and upon stop, bitlbee does not kill those children to not cut off connections. This is used for upgrade, so new clients get connected to upgraded bitlbee while already connected clients retain the old connections. Reproducible: Always Steps to Reproduce: 1. /etc/init.d/bitlbee start 2. connect some irc clients to bitlbee 3. /etc/init.d/bitlbee restarat Actual Results: # /etc/init.d/bitlbee restart * Caching service dependencies ... [ ok ] * Stopping bitlbee ... [ ok ] * Starting bitlbee ... * start-stop-daemon: /usr/sbin/bitlbee is already running [ !! ] * ERROR: bitlbee failed to start Expected Results: restart bitlbee
Created attachment 313771 [details] initscript patch
Thanks for submitting this initscript fix, assigning to maintainers
This problem hasn't been resolved for me. start-stop-daemon still fails to kill the process with ESTABLISHED tcp connections. I've noticed it forks child processes regardless of whether or not Daemon or ForkDaemon is set in the config.
Created attachment 322774 [details] /etc/init.d/bitlbee patch
Since bitlbee creates the user and group bitlbee:bitlbee on install, I've found that using user-based termination with start-stop-daemon yielded better results. YMMV.
The pid file isn't being generated on my system,(In reply to Xenith from comment #5) > Since bitlbee creates the user and group bitlbee:bitlbee on install, I've > found that using user-based termination with start-stop-daemon yielded > better results. YMMV. That'd kill off all children, all active sessions. Unnecessarily, imho.
Created attachment 384580 [details, diff] Patch to fix pidfile usage This fix fixes the pidfile usage, and doesn't unnecessarily kill live sessions (children) during a restart.
This is fixed in bitlbee-3.2.1-r1. I used Xenith's user-based termination. This is what I'd expect the init script to do, anyway. Many thanks. /etc/init.d/bitlbee restart * Stopping bitlbee ... [ ok ] * Starting bitlbee ... [ ok ] :)