I have some daemons that use PID files to prevent parallel execution of my program.  I have set up a signal handler to trap SIGTERM and do the necessary clean-up including the PID file.  This works great when I test using "kill -s SIGTERM #PID".  However, when I reboot the server the PID files are still hanging around preventing start-up of the daemons.  It is my understanding that SIGTERM is sent to all processes when a server is shutting down.  Should I be trapping another signal (SIGINT, SIGQUIT?) in my daemon?
Not a direct solution but it might be a good idea to check for an actual process running with the pid in the pid file at startup and if none exists, to cleanup the stale file. 
It's possible that your process is getting a SIGKILL before it has a chance to cleanup the pid file.
PID files hanging around for daemons after server restart