2

From the systemd manual:-

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.

Currently, there is an issue with shutting down my system wherein the kernel keeps printing the message "unregister_netdevice: waiting for to get free:Instance count=1" even 10 minutes after issuing reboot command. I don't know what could be causing this issue, but I was hoping ShutdownWatchdogSec would force reboot in this and other scenarios.

However the system doesn't shut down within the stipulated time. It still takes 10+min. I have made the required change in my /etc/systemd/system.conf:

ShutdownWatchdogSec=4min

Watchdog seems to be present on my system

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
  • It's a custom distribution built using the Yocto SDK. Out of curiosity, does that matter if it is a standard version of systemd – Bug Killer Oct 13 '16 at 19:05
  • Yes, sometimes it matters. Some distributions like to do things differently, or completely strangely, for no apparent reason. And some people reading the question will attempt to reproduce the problem, and as much detail about the environment as possible is required for this. – Michael Hampton Oct 13 '16 at 19:30
  • Is this system running Docker? There is a known bug with systems running Docker along these lines... – Michael Hampton Oct 13 '16 at 19:35
  • no, there is no docker – Bug Killer Oct 13 '16 at 21:22
0

You are confusing software watchdog (user process /usr/sbin/watchdog you are showing with ps) with hardware watchdog which is kernel feature (/dev/watchdog). You should check your kernel configuration to make sure it is enabled. If it is enabled you will see line like this in kernel boot log:

[X.XXXX] Hardware watchdog '<some bsp related name>', version XXXX
  • I have edited the question to provide the information – Bug Killer Nov 4 '16 at 22:01
  • @BugKiller there could be one more thing: /dev/watchdog can be opened only once, so if you have some user space daemon that opened it already (watchdogd), systemd cannot open it and just ignores watchdog related options (unfortunately silently). Try to disable watchdogd and if you need runtime watchdog you can also use systemd instead of watchdogd - just add RuntimeWatchdogSec=XXs – pmod Nov 8 '16 at 10:02
  • @BugKiller Another issue could be if 4min is above supported range limit. But in this case you should see [ XX.XXXX] systemd[1]: Failed to set timeout to 240s: Invalid argument – pmod Nov 8 '16 at 12:39
0

This worked when I compiled the kernel with the option CONFIG_WATCHDOG_NOWAYOUT. Without this setting, the kernel disables the watchdog when the daemon is stopped.

Also, the error unregister_netdevice went away when I upgraded to 4.4 kernel

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.