mr-orange/Sick-Beard — pull request #316 by shtrom (2013-09-25 01:08:06+00:00)
Title: Remove PID_FILE after successful start-stop-daemon --stop in Debian init script

SickBeard is happy to create its own PID file, but doesn't remove it when
killed by start-stop-daemon(8). Upon being restarted, it find the previous PID
file, assumes it hasn't been stopped properly, and refuses to restart.

This ini.d script change fixes that, by letting the stratup script remove the
PID file after start-stop-daemon(8) has terminated properly.

At the moment, this fix probably does not handle incorrect terminations such as
power cuts well, as the PID file would still be there at the next boot, but the
SickBeard process obviously not. This problem would probably be better fixed
by letting SickBeard check whether the PID recorded in the PID file is still a
running SickBeard instance.

Signed-off-by: shtrom-sickbeard@ssji.net