Raspberry Pi 4 - Watchdog not working - bug or configuration issue?

I’m using core 20 on Raspberry Pi 4. Using the latest published snaps.

As soon as I set the watchdog runtime-timeout, systems starts rebooting every minute - regardless of the timeout. It appears the watchdog is being enabled, but never serviced.

Configuration before - as expected, runtime timeout not set, no 10-snapd-watchdog.conf file:

$ snap list
 Name       Version        Rev    Tracking       Publisher   Notes
 core20     20210319       974    latest/stable  canonical?  base
 pi         20-1           89     20/stable      canonical?  gadget
 pi-kernel  5.4.0-1025.28  231    20/stable      canonical?  kernel
 snapd      2.49.2         11584  latest/stable  canonical?  snapd
$ cat /etc/systemd/system.conf.d/10-snapd-watchdog.conf
cat: /etc/systemd/system.conf.d/10-snapd-watchdog.conf: No such file or directory
$ systemctl show | grep -i watchdog
RuntimeWatchdogUSec=0
RebootWatchdogUSec=10min
KExecWatchdogUSec=0
ServiceWatchdogs=yes

Next, I set runtime-timeout to 15 min. Resulting configuration looks good

$ snap set core watchdog.runtime-timeout=15m
$ cat /etc/systemd/system.conf.d/10-snapd-watchdog.conf
[Manager]
RuntimeWatchdogSec=900
$ systemctl show | grep -i watchdog
RuntimeWatchdogUSec=15min
RebootWatchdogUSec=10min
KExecWatchdogUSec=0
ServiceWatchdogs=yes

Approximately 60 seconds later, board will reset. It will boot successfully, run for about 60 secs, then reboot again. I can break it out of loop by clearing runtime-timeout.

Thoughts?
Dan

I would suggest to enable persistent journal (snap set system journal.persistent=true), then enable watchdog, wait for a reboot, disable it and inspect the journal.

Thanks for the suggestion. In the logs I see the following when I set runtime-timeout=10m

Hardware watchdog ' Broadcom BCM2835 Watchdog timer', version 0
Failed to set timeout to 600s: Invalid argument

The failure matches this line in systemd version 245

Not sure why ioctl is failing, or watchdog remains enabled after failure to set timeout, but something to go on.

Followup - appears BCM2835 only support timeout of up to 15 secs. Setting timeout to 15 secs worked

https://raspberrypi.stackexchange.com/questions/71052/changing-watchdog-timeout-on-rpi3

1 Like