in reply to Race condition in my cron daemon
why do you need this PID checking with a database?
UPDATE: Should have read your code better...Ignore this post