What distribution or operating system are you referring to? In linux the init.d files do exactly this by writing out PID files to see if the program is still alive when it re-executes.
Please provide more information.
Reputation Points: 1749
Solved Threads: 735
Senior Poster
Offline 3,948 posts
since Feb 2009