This guide is about how to setup
watchdog in Ubuntu.
Ubuntu V180531 the watchdog is enabled by default. However, for newer versions it’s disabled by default. You can use the following commands to enable it.
$ sudo ln -s /lib/systemd/system/watchdog.service /etc/systemd/system/multi-user.target.wants/watchdog.service
$ sudo systemctl enable watchdog.service
$ sudo systemctl start watchdog.service
Tip: You need to create the service link manually, due to a debian bug.
The default timeout is
10S, you can change it in
$ sudo vim /etc/watchdog.conf
watchdog-timeout to change the timeout.
Restart watchdog service.
$ sudo systemctl restart watchdog
Trigger a Kernel crash.
$ sudo -i
root@Khadas:~# echo c > /proc/sysrq-trigger
watchdog setup successfully, the system will reboot after the timeout you set above.
$ sudo systemctl disable watchdog