Digi Embedded Yocto includes a system watchdog service that reboots the device in the event of a system crash. This is a last-resort watchdog intended to recover from general system malfunctions like kernel crashes.
Failures that affect a device’s functionality without crashing the system should be handled through the system monitor.
To enable the system watchdog, edit the file /etc/systemd/system.conf and uncomment the following entries:
RuntimeWatchdogSec=<refresh-time> ShutdownWatchdogSec=<hard-reboot-time>
Where:
-
refresh-time: A timeout to specify the refresh time. If the watchdog is not refreshed in that period of time the system will start a controlled reboot. Systemd automatically refreshes the watchdog with frequency of refresh-time/2.
-
hard-reboot-time: A timeout value that is set on the controlled reboot. If after the specified time the system is still running, the system initiates a hard uncontrolled reboot.
Timeout values are specified in seconds, or other time unit if specified in a suffix. See systemd documentation for details.
For example:
RuntimeWatchdogSec=60 ShutdownWatchdogSec=10min
The watchdog runs with a systemd restart or a system reboot.