1 1
tomsaul

System watchdog package usage

Recommended Posts

I have installed the 'watchdog' package (apt-get install watchdog' on an Orange Pi Plus 2E, and it does not seem to be working as I would expect.  If I write output to /dev/watchdog the system will reboot, but if I stop the watchdog service (and wd_keepalive) the system does not reboot.  I did un-comment the path to /dev/watchdog in the settings file, but have generally not changed anything else.  Is there some other required setup needed to allow this to function?

 

 

Share this post


Link to post
Share on other sites

Here is my solution:

echo '@reboot root while true ; do echo 1 > /dev/watchdog ; sleep 3 ; done' >>/etc/crontab

 

Everything else fails. Doing 'cat /dev/watchdog' or 'echo 1 >/dev/watchdog' makes the system reboot 16s later ... prooving the hardware part works fine, but that the service is not doing it's job properly. Some people say there should be one process per core. Other people have more than 1 line out of 'dmesg | grep wat'

 

This second form procudess less mess in dmesg and syslog:

 

echo '@reboot root { while true ; do echo 1 ; sleep 1 ; done ; } > /dev/watchdog' >>/etc/crontab

 

But both may be unreliable; depending on which shell interprets the line, things like bash may produce a routine that is always run by the same process; so if the kernel is lacking of memory, or can not create any new process, that snipset may keep feeding watchdog even on a dead machine. So, this (untested) method may be reliable to track process creation issues:

 

echo '* * * * * root { for i in $(seq 11) ; do echo 1 ; sleep 10 ; done ; } > /dev/watchdog' >>/etc/crontab

but it will produce one line of garbage per minute.

 

In either case, have fun killing the parent process, and you get a reboot. Proofing my stupid line works better than the service installed by 'apt-get install watchdog', even after loosing 2h in /etc/default/watchdog and /etc/watchdog.conf

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
1 1