[systemd-devel] How to check watchdog status?

Adam Nielsen a.nielsen at shikadi.net
Fri Jan 7 14:19:11 UTC 2022


Hi all,

If I have asked systemd to make use of a hardware watchdog by setting
RuntimeWatchdogSec in systemd.conf, how can I work out whether systemd
is actually using the hardware watchdog or not?

There is a non-systemd command "wdctl" which queries /dev/watchdog0 and
tells you things like what the current timeout is set to, however
on some of my machines this works, but on others it gives an error
saying /dev/watchdog0 is unavailable.

Some reading suggests only one program can access /dev/watchdog0 at a
time, so I am not sure whether this means systemd is already using the
watchdog and that's why wdctl can't access it, or does it mean the
watchdog hardware isn't working properly?  On the machines where wdctl
does print details about /dev/watchdog0, does this mean systemd has not
taken ownership of it, or does that device allow multiple instances of
the watchdog?

I'm looking for something like `systemctl list-timers` that shows the
status of the hardware watchdog instead, but I can't seem to find a
command that does this.

How does one go about querying systemd for the current state of the
hardware watchdog(s), without having to install additional external
utilities?

Many thanks,
Adam.


More information about the systemd-devel mailing list