Implemented watchdog logic.
Watchdog logic now prints PID and message before exit().