How to use Linux software watchdog?

后端 未结 9 2253
星月不相逢
星月不相逢 2020-12-05 05:02

Can anybody tell me how to handle the software watchdog in Linux?

I have a program SampleApplication which runs continuously and I need to restart it if

9条回答
  •  萌比男神i
    2020-12-05 05:54

    You can try wdog which is a utility written in c++ and linking against the Kahless_9 framework. The source code for this can be downloaded from: https://github.com/zepher999/wdog and consequently updated to suite your own needs. There is still some TODO list changes required for the future but as is this should cater for your current requirements.

    The utility requires a csv file as input wherein all processes to be watched with their arguments are contained. Upon startup, the utility starts all of these processes designated in the csv file and monitors them for exit/termination whereupon it restarts the process.

    Currently wdog allows for the stopping/killing of monitored processes as well as the ability to startup the utility in hot or cold mode. Hot mode allows the utility to use cached records to monitor already started processes while cold mode starting discards such cached values thereby attempting to start all processes.

    The utility also has the ability to launch an instance of itself to monitor itself, thereby having a watchdog for the watchdog.

提交回复
热议问题