The watchdog user space interface
On Linux-based systems, the standard user space interface to the watchdog is the /dev/watchdog
file, through which a daemon will notify the kernel watchdog driver that the user space is still alive. The watchdog starts right after the file is opened, and gets pinged by periodically writing into this file.
When the notification occurs, the underlying driver will notify the watchdog device, which will result in resetting its timeout; the watchdog will then wait for yet another timeout
duration prior to resetting the system. However, if for any reason the user space does not perform the notification before the timeout is elapsed, the watchdog will reset the system (causing a reboot). This mechanism provides a way to enforce the system availability. Let's start with the basics, learning how to start and stop the watchdog.
Starting and stopping the watchdog
The watchdog is automatically started once you open the /dev/watchdog
device file,...