私の組み込みLinuxシステムにwatchdogをインストールしました。
watchdog.service ファイル
[Unit]
Description=watchdog daemon
[Service]
Type=forking
EnvironmentFile=/etc/default/watchdog
ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module'
ExecStart=/bin/sh -c '[ x$run_watchdog != x1 ] || exec /usr/sbin/watchdog $watchdog_options'
PIDFile=/var/run/watchdog.pid
[Install]
WantedBy=default.target
それから処刑した。
ln /lib/systemd/system/watchdog.service /etc/systemd/system/
systemctl enable watchdog.service
Synchronizing state of watchdog.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable watchdog
Adding system startup for /etc/init.d/watchdog.
Created symlink /etc/systemd/system/default.target.wants/watchdog.service → /etc/systemd/system/watchdog.service.
/etc/default/watchdog
# Start watchdog at boot time? 0 or 1
run_watchdog=1
watchdog_module="bcm2835-wdt"
watchdog_restart=1
ウォッチドッグ構成ファイル
root@raspberrypi-cm3:/etc# cat watchdog.conf
#ping = 172.31.14.1
#ping = 172.26.1.255
#interface = eth0
file = /var/log/messages
max-load-1 = 24
# Note that this is the number of pages!
# To get the real size, check how large the pagesize is on your machine.
min-memory = 1
watchdog-device = /dev/watchdog
watchdog-timeout = 15
# This greatly decreases the chance that watchdog won't be scheduled before
# your machine is really loaded
realtime = yes
priority = 1
再起動後、ウォッチドッグは機能しません。これに関するバグレポートがあります。提案されたパッチはインストールセクションを追加することです。
[Unit]
Description=watchdog daemon
Conflicts=wd_keepalive.service
After=multi-user.target
OnFailure=wd_keepalive.service
[Service]
Type=forking
EnvironmentFile=/etc/default/watchdog
ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module'
ExecStart=/bin/sh -c '[ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options'
ExecStopPost=/bin/sh -c '[ $run_wd_keepalive != 1 ] || false'
[Install]
WantedBy=default.target
ところがご覧のように、設置部分はすでに確保しておいても、まだ同じ問題が発生します。どんな助けでも大変感謝します。