看门狗守护进程无法在重新启动时启动

看门狗守护进程无法在重新启动时启动

我已经在我的嵌入式Linux系统上安装了看门狗。

看门狗.服务文件

[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/默认/看门狗

# 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

但正如你所看到的,我已经有了安装部分,但我仍然面临同样的问题。任何帮助将不胜感激

相关内容