I want to create a program that runs forever, which there is only one instance running at a time and that can be launched with an init.d script. python-daemon seems to be a good choice to do that as it is the reference implementation of PEP 3143.
Anyway I can't understand what the PID lock file is for, since it doesn't prevent the program to be run twice.
Should I manually check for the existence of the lock file in my init.d script (based on '/etc/init.d/skeleton') ? Also how am I supposed to kill it ? Get the PID number in the PID file and send a SIGTERM ?
Thanks a lot.