Skip to content

Instantly share code, notes, and snippets.

@jameswhite
Created February 5, 2017 18:04
Show Gist options
  • Select an option

  • Save jameswhite/312ead576f32de3ed83f17d780ef3718 to your computer and use it in GitHub Desktop.

Select an option

Save jameswhite/312ead576f32de3ed83f17d780ef3718 to your computer and use it in GitHub Desktop.
grep -q "bcm2835_wdt" /etc/modules || echo "bcm2835_wdt" | sudo tee -a /etc/modules
dpkg -l | grep -q "ii *watchdog" || sudo apt-get install -y watchdog
[ ! -f /etc/watchdog.conf.dist ] && sudo cp /etc/watchdog.conf /etc/watchdog.conf.dist
cat<<EOF | sudo tee /etc/watchdog.conf
max-load-1 = 24
watchdog-device = /dev/watchdog
realtime = yes
priority = 1
EOF
sudo update-rc.d watchdog defaults
# sudo update-rc.d watchdog enable 2
sudo /etc/init.d/watchdog start
sudo modprobe bcm2835_wdt
# add: /lib/systemd/system/watchdog.service
[Install]
WantedBy=multi-user.target
# Then
systemctl enable watchdog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment