← 返回命令列表

Linux command

watchdog 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Start watchdog daemon

sudo systemctl start watchdog

Enable at boot

sudo systemctl enable watchdog

Test configuration

sudo watchdog -v

Run in foreground

sudo watchdog -f

Force test mode

sudo watchdog -F

说明

watchdog is a daemon that monitors system health and resets the system if problems are detected. It periodically writes to /dev/watchdog to prevent the kernel from triggering a hardware reset. The daemon can monitor various system conditions: load average, memory usage, file presence, process existence, temperature, and custom test scripts. If any check fails, the system reboots after logging the failure reason. Hardware watchdog support requires appropriate kernel modules (e.g., iTCO_wdt for Intel). Software watchdog via the softdog module provides fallback when hardware isn't available.

参数

-f, --foreground
Run in foreground, don't fork.
-F, --force
Force test mode.
-v, --verbose
Verbose output.
-c _file_
Use specified configuration file.
-s, --sync
Sync before reboot.
--help
Display help.

FAQ

What is the watchdog command used for?

watchdog is a daemon that monitors system health and resets the system if problems are detected. It periodically writes to /dev/watchdog to prevent the kernel from triggering a hardware reset. The daemon can monitor various system conditions: load average, memory usage, file presence, process existence, temperature, and custom test scripts. If any check fails, the system reboots after logging the failure reason. Hardware watchdog support requires appropriate kernel modules (e.g., iTCO_wdt for Intel). Software watchdog via the softdog module provides fallback when hardware isn't available.

How do I run a basic watchdog example?

Run `sudo systemctl start watchdog` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f, --foreground do in watchdog?

Run in foreground, don't fork.