2020-10-30 08:08 AM
I am using the STM32MP15-DK2 dev board and with a modified device tree to enable some peripherals. I would like to use /dev/watchdog to reset if ever my application hangs. But whenever I try to open the device I get
Error opening watchdog device: Device or resource busy
I have the watchdog functions commented out in /etc/systemd/system.conf
#RuntimeWatchdogSec=0
#RebootWatchdogSec=10min
#ShutdownWatchdogSec=10min
#KExecWatchdogSec=0
#WatchdogDevice=
and all the info i get from fuser is
root@stm32mp1:/etc/systemd# fuser /dev/watchdog
1
I can't figure out what is causing the error. Does has anyone dealt with this problem before?
Thanks
2020-11-05 07:42 AM
Hi @ASuar.1
Sounds like a known issue in version V1.2 .. do you confirm it's the one you are actually using ?
Olivier
2020-11-05 07:50 AM
I believe so. In the end I just decided to use systemd to monitor my application.
I created the following service:
[Unit]
Description=application
After=multi-user.target
StartLimitIntervalSec=5min
StartLimitBurst=4
StartLimitAction=reboot-force
[Service]
Type=notify
ExecStart=/opt/my_app
Restart=on-failure
WatchdogSec=30s
[Install]
WantedBy=multi-user.target
and call sd_notify(0, "WATCHDOG=1") from my application. It works well enough and even reboots my the processor if to many failures occur.
2020-11-05 09:11 AM
Hi @ASuar.1
please note that from OpenSTLinux v2.0.0 Dunfell, the watchdog config for systemd is in /lib/systemd/system.conf.d/01-watchdog.conf
BR
Jean-Philippe