If you use a Raspberry Pi, one feature you may not be aware of is that it has a hardware watchdog. When enabled and properly configured, if the system freezes up, the hardware watchdog will reset the system. That’s pretty convenient if you’re putting a Raspberry Pi somewhere remote, like a tower site. Here are instructions for enabling the watchdog on a Raspberry Pi 2 running Raspbian Jessie.
Install the watchdog package:
1 |
sudo apt-get install watchdog |
Load the module manually:
1 |
sudo modprobe bcm2708_wdog |
Then, add a config to automatically load the module:
1 2 |
# /etc/modules-load.d/bcm2708_wdog.conf bcm2708_wdog |
We’ll also need to manually edit the systemd unit at /lib/systemd/system/watchdog.service and add a line to the [Install] section:
1 2 |
[Install] WantedBy=multi-user.target |
Then enable the service:
1 |
systemctl enable watchdog.service |
Finally, start the service:
1 |
systemctl start watchdog.service |
You can set various options for the watchdog in /etc/watchdog.conf – see the man page for that file.