Raspberry Pi Watchdog - aaronwmorris/indi-allsky GitHub Wiki

Overview

A watchdog is usually a piece of hardware that has the ability to reset or power-cycle equipment that stops responding, in effect a Dead Man's Switch. Using a watchdog needs two components:

  1. The hardware watchdog
  2. Software that sends the heartbeat signal

The watchdog hardware has an internal timer that will reset the system if it is allowed to reach the end. The software continually sends a heartbeat signal to indicate the system is still working. If the software ever stops sending the signal, or slows down enough, the watchdog will intervene.

Hardware Support

Raspberry Pi (and almost all single board computers) have native watchdog capabilities.

Many PCs including NUCs also have watchdog capabilities. The instructions below should work on most systems.

Setup

As root, create /etc/systemd/system.conf.d

sudo mkdir /etc/systemd/system.conf.d

Create /etc/systemd/system.conf.d/watchdog.conf

sudo tee /etc/systemd/system.conf.d/watchdog.conf <<EOF
[Manager]
RuntimeWatchdogSec=10
ShutdownWatchdogSec=10min 
EOF

Reboot!