Implementing a watchdog system

Hello, I need to implement a reliable watchdog functionality for an application that is supposed to run on the TRB145. My current approach is to run a script that:

  1. Uses ubus to stop the dogwatch and allow for manual poking
ubus call system watchdog '{"timeout":30}' && ubus call system watchdog '{"magicclose":true}' && ubus call system watchdog '{"stop":true}'
  1. Periodically checks for a heartbeat signal from my separate application, manually triggers the reboot if the app stops sending a signal, otherwise pokes the watchdog, and keeps checking for app health.

The manual reboot in case the app stops sending the signal works quite well and the device is rebooted as expected, but I am having some problems with the watchdog. I expected that after executing the code above, if one stops manually poking the watchdog the device would be rebooted as well but that does not seem to be the case. I was hoping that the watchdog would be a possible solution for a failsafe, in case the script gets terminated for any reason and the heartbeat from the application wouldn’t get checked anymore.

Is there anything missing from my approach which would make it function? If not, is there any alternative solution to achieve the same functionality? Many thanks for any help.

This topic was automatically closed after 60 days. New replies are no longer allowed.