The linux watchdog timer allows the linux kernel to reset the system if serious problems are detected.
It's composed of three different layers:
- watchdog hardware (hardware)
- watchdog driver (kernel)
- watchdog daemon (userspace)
The watchdog driver makes available in the procfs the corresponding
device file to make the link between the hardware and userspace.
By default, the device file is located in /dev/watchdog.
-
The watchdog daemon opens /dev/watchdog.
-
It keeps writing to the device file often enough to prevent the kernel from resetting. (at least once per minute). Each write delays the reboot time another minute.
-
If a system issue occurs (process table full, not enough free memory, temperature too high, file table overflow, ...) describes in man (8) wdctl. The watchdog the daemon will stop writing to the device file.
-
After a minute of inactivity the watchdog hardware will cause the reset.
Show hardware watchdog information.
The default device file used is /dev/watchdog.
Note that the number of supported watchdog features is hardware specific.
- Watchdog Timer - Wikipedia
- Watchdog API - Kernel.org
- wdctl - man (8) wdctl
sudo ./watchdog
Device: /dev/watchdog
Identity: iTCO_wdt [version 0]
Timeout: 30 seconds
Pre-timeout: 0 seconds
Timeleft: 30 seconds
Last boot: Power-On-Reset
This project is licensed under the MIT License - see the LICENSE file for details