khadas@Khadas:~$ systemctl status watchdog.service ● watchdog.service - watchdog daemon Loaded: loaded (/lib/systemd/system/watchdog.service; enabled; vendor pres> Active: active (running) since Fri 2021-03-26 10:00:38 UTC; 15min ago Process: 3381 ExecStartPre=/bin/sh -c [ -z "${watchdog_module}" ] || [ "${w> Process: 3382 ExecStart=/bin/sh -c [ $run_watchdog != 1 ] || exec /usr/sbin> Main PID: 3385 (watchdog) Tasks: 1 (limit: 2932) Memory: 864.0K CGroup: /system.slice/watchdog.service └─3385 /usr/sbin/watchdog -s -v -c /etc/watchdog.conf Mar 26 10:15:38 Khadas watchdog[3385]: still alive after 120 interval(s) Mar 26 10:15:39 Khadas watchdog[3385]: still alive after 121 interval(s) Mar 26 10:15:40 Khadas watchdog[3385]: still alive after 122 interval(s) Mar 26 10:15:41 Khadas watchdog[3385]: still alive after 123 interval(s) Mar 26 10:15:42 Khadas watchdog[3385]: still alive after 124 interval(s) Mar 26 10:15:43 Khadas watchdog[3385]: still alive after 125 interval(s) Mar 26 10:15:44 Khadas watchdog[3385]: still alive after 126 interval(s) Mar 26 10:15:45 Khadas watchdog[3385]: still alive after 127 interval(s) Mar 26 10:15:46 Khadas watchdog[3385]: still alive after 128 interval(s) Mar 26 10:15:47 Khadas watchdog[3385]: still alive after 129 interval(s) lines 1-21/21 (END)
Setup Watchdog Timeout
The default timeout is 15S, you can edit file /etc/watchdog.conf to change the timeout watchdog-timeout.
Restart watchdog service to take effect.
1
$ sudo systemctl restart watchdog
Test Watchdog
Trigger a Kernel Crash.
1 2
khadas@Khadas:~$ sudo -i root@Khadas:~# echo c > /proc/sysrq-trigger
If watchdog setup successfully, the system will reboot after the timeout you set above.
Kill Watchdog Daemon
You can also kill the watchdog daemon to prevent it to feed the watchdog, so the system will reboot after the timeout set in /etc/watchdog.conf.