如何为raspberry pi 3激活bcm2835_wdt看门狗内核模块?

时间:2018-01-11 16:17:10

标签: raspberry-pi kernel watchdog

我一直试图激活覆盆子pi 3的bcm2835_wdt看门狗模块6小时,但我不能。

modprobe bcm2835_wdt不返回错误,但lsmod命令不会返回列表中的bcm2835_wdt模块。

我已经加载了watchdog和chkconfig 然后;

sudo chkconfig watchdog on

当我尝试启动服务时

sudo /etc/init.d/watchdog start

我收到了错误

[....] Starting watchdog (via systemctl): watchdog.service Job for watchdog.service failed because the control process exited with error code.
See "systemctl status watchdog.service" and "journalctl -xe" for details.
 failed!

journalctl -xe  returns;

-- Kernel start-up required 2093448 microseconds.
-- 
-- Initial RAM disk start-up required INITRD_USEC microseconds.
-- 
-- Userspace start-up required 5579375635 microseconds.
Jan 11 16:03:45 al sudo[935]:     root : TTY=pts/1 ; PWD=/ ; USER=root ; COMMAND=/etc/init.d/watchdog start
Jan 11 16:03:45 al sudo[935]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Jan 11 16:03:46 al systemd[1]: Starting watchdog daemon...
-- Subject: Unit watchdog.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit watchdog.service has begun starting up.
Jan 11 16:03:46 al sh[949]: modprobe: **FATAL: Module dcm2835_wdt not found in directory /lib/modules/4.9.59-v7+**
Jan 11 16:03:46 al systemd[1]: watchdog.service: Control process exited, code=exited status=1
Jan 11 16:03:46 al systemd[1]: Failed to start watchdog daemon.
-- Subject: Unit watchdog.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit watchdog.service has failed.

我的问题是如何为raspberry pi3启用看门狗内核模块bcm2835_wdt?

提前谢谢你......

1 个答案:

答案 0 :(得分:0)

可能bcm2835_wdt已编译到系统的内核中,所以你没有用lsmod看到它。试试吧:

# cat /lib/modules/$(uname -r)/modules.builtin | grep wdt
kernel/drivers/watchdog/bcm2835_wdt.ko

如果你可以在列表中看到它,它已在内核中编译。您可能还会看到它是否已启用:

journalctl --no-pager | grep -i watchdog

关于监视程序配置,请参阅此错误:

modprobe: **FATAL: Module dcm2835_wdt not found in directory /lib/modules/4.9.59-v7+**

模块名为dcm2835_wdt,而不是bcm2835_wdt。 另外,请记住,SystemD可能会使用您的监视程序,因此您应该参考它来使用它。

如果您不介意,您也可以尝试使用fork炸弹,看看看门狗是否能够在检测到问题时重新启动系统:

python -c "import os, itertools; [os.fork() for i in itertools.count()]"