I am trying to implement a watchdog timer that reboots the Linux OS running on the Yun. I came across the watchdog and issued the following command
watchdog -t 5 -T 60 /dev/watchdog
This starts a watchdog daemon and it appears that the watchdog is automatically reset by the command. I was looking something similar to what you would do on a microcontroller. I would like to be able to reset the watchdog @ /dev/watchdog from the application I am running.
Is there a way of achieving this?
Yun OS has watchdog daemon install and enabled.
root@Arduino:~# ps |grep watchdog
1347 root 1492 S /sbin/watchdog -t 5 /dev/watchdog
2792 root 1484 S grep watchdog
watchdog --help
BusyBox v1.19.4 (2014-11-13 19:03:47 CET) multi-call binary.
Usage: watchdog [-t N[ms]] [-T N[ms]] [-F] DEV
Periodically write to watchdog device DEV
-T N Reboot after N seconds if not reset (default 60)
-t N Reset every N seconds (default 30)
-F Run in foreground
Use 500ms to specify period in milliseconds
watchdog -t 5 -T 60 /dev/watchdog
means reset the watchdog every 30 seconds with 60 second timeout
same as
/sbin/watchdog -t 5 /dev/watchdog
So No need to issued the that command.
To trigger watchdog:
root@Arduino:~# uptime
20:26:52 up 53 min, load average: 0.00, 0.03, 0.04
pgrep watchdog | xargs kill -SIGSTOP
root@Arduino:~# uptime
20:29:22 up 1 min, load average: 0.42, 0.21, 0.08