I have some daemons that use PID files to prevent my program from running in parallel. I set up a signal handler to capture SIGTERM and perform the necessary cleanup, including the PID file. This works great when I test using "kill -s SIGTERM #PID". However, when I restart the server, PID files still hang around preventing daemons from starting. As I understand it, SIGTERM is sent to all processes when the server is shutting down. Should I pick up another signal (SIGINT, SIGQUIT?) In my daemon?
source
share