Skip to main content
Tweeted twitter.com/#!/StackUnix/status/38830935843680256
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k
Source Link
Justin Ethier
  • 17.2k
  • 9
  • 46
  • 55

Linux: Writing a watchdog to monitor multiple processes

A few years ago, a coworker came up with an elegant solution for a watchdog program. The program ran on Windows and used Windows Event objects to monitor the process handles (PID’s) of several applications. If any one of the processes terminated unexpectedly, its process handle would no longer exist and his watchdog would immediately be signaled. The watchdog would then take an appropriate action to “heal” the system.

My question is, how would you implement such a watchdog on Linux? Is there a way for a single program to monitor the PID’s of many others?