来自systemd 手册:-
ShutdownWatchdogSec=
ShutdownWatchdogSec= may be used to configure the hardware watchdog when the system is asked to reboot.
It works as a safety net to ensure that the reboot takes place even if a clean reboot attempt times out.
By default RuntimeWatchdogSec= defaults to 0 (off), and ShutdownWatchdogSec= to 10min.
These settings have no effect if a hardware watchdog is not available.
目前,关闭系统时出现问题,即使在发出重启命令 10 分钟后,内核仍会继续打印消息“unregister_netdevice:正在等待释放:实例计数=1”。我不知道是什么原因导致了这个问题,但我希望 ShutdownWatchdogSec 能够在这种和其他情况下强制重启。
但是系统没有在规定的时间内关闭。它仍然需要 10 多分钟。我在 /etc/systemd/system.conf 中进行了必要的更改:
ShutdownWatchdogSec=4min
我的系统上似乎有看门狗
root@bugkiller:~# dmesg|grep watchdog
[ 0.044094] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
[ 4.051861] systemd[1]: Hardware watchdog 'iTCO_wdt', version 0
[ 4.051874] systemd[1]: Set hardware watchdog to 1min 4s.
root@re0:~# uname -a
Linux re0 4.1.15-foo-00929-g15aa5b3 #1 SMP PREEMPT Mon Oct 3 18:01:53 PDT 2016 x86_64 GNU/Linux
root@re0:~# systemctl --version
systemd 219
+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN
答案1
当我使用选项 CONFIG_WATCHDOG_NOWAYOUT 编译内核时,此方法有效。如果没有此设置,则内核会在守护进程停止时禁用看门狗。
此外,当我升级到 4.4 内核时,unregister_netdevice 错误消失了
答案2
你很困惑软件看门狗(用户进程)/usr/sbin/watchdog你正在展示附言) 和硬件看门狗是内核功能(/dev/watchdog)。您应该检查内核配置以确保它已启用。如果已启用,您将在内核启动日志中看到如下行:
[X.XXXX] Hardware watchdog '<some bsp related name>', version XXXX