1

Are there any watchdog tools or libraries on Linux for the following purpose? I would like to build a watchdog executable which starts 2 processes and restarts them if:

  • processes crash
  • processes become unresponsive (e.g. hang for some reason)

Internet search found watchdog.c but I am not sure if that can be used for my purposes, it looks pretty low level.

I could run my processes as init programs (daemons) as suggested here, but I am not sure if Linux would then recognize that the process is hanging (e.g. due to a deadlock)

Community
  • 1
  • 1
Paul
  • 2,474
  • 7
  • 33
  • 48

1 Answers1

2

We use monit here: http://mmonit.com/monit/ it will let you do the restart thing it is also highly customizable regarding how to check and how to react via scripts

marcelog
  • 7,062
  • 1
  • 33
  • 46