LoginSignup
13
21

More than 5 years have passed since last update.

Raspberry Pi 3/ Zero / Zero W等で watchdogを有効化する

Last updated at Posted at 2017-11-09

Overview

Raspberry Pi3をサーバーにして、1日1回再起動させたりもしているが、たまに固まることがある。
そこで、Raspberry Pi 3/ Zero / Zero W等で watchdogを有効化にしてみます。

diff表記にします。

- が先頭の行は修正前
+ が先頭の行は修正後 (+ は不要)

/bootの編集

/boot/config.txt
-#dtparam=watchdog=off
+dtparam=watchdog=on

watchdog.conf

/etc/modprobe.d/bcm2835-wdt.conf
+options bcm2835_wdt heartbeat=10 nowayout=0

system.conf

/etc/systemd/system.conf
-#RuntimeWatchdogSec=0
+RuntimeWatchdogSec=5

watchdog.confで、10秒間heartbeatが来ないと再起動に設定したので、
5秒おきにheartbeatするように設定する例です。

再起動して、dmesg | grep bcm とかして watchdogが動いてることを確認してください。

13
21
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
21