-3

I can"t use the device /dev/watchdog because something using it.

echo 1 > /dev/watchdog -> Ressource busy

Tests (as root) :

ls 
crw-rw-rw- 1 root root  10, 130 27 juil. 12:34 /dev/watchdog
crw-rw-rw- 1 root root 251,   0 27 juil. 12:34 /dev/watchdog0

lsof /dev/watchdog
COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
systemd   1 root   40w   CHR 10,130      0t0 8206 /dev/watchdog


fuser -v /dev/watchdog
                     UTIL.       PID ACCÈS  COMMANDE
/dev/watchdog:       root          1 F.... systemd

I have no ideas why i can't access to this device.

Kernel : 4.11 Driver : iTCO_wdt and softdog -> same behavior

Thx for your help.

user179663
  • 47
  • 1
  • 6

2 Answers2

1

Disabling the systemd watchdog inside the configuration file : /etc/systemd/system.conf worked for me.

user179663
  • 47
  • 1
  • 6
0

Why the 'device or resource busy' error

The issue I found was that systemd and wd_keepalive seemed to be using the watchdog resource per fuser output:

>sudo fuser -v /dev/watchdog
                     USER        PID ACCESS COMMAND
/dev/watchdog:       root      15087 F.... wd_keepalive

and

>sudo fuser -v /dev/watchdog
                     USER        PID ACCESS COMMAND
/dev/watchdog:       root          1 F.... systemd

Fix the Busy Error

I removed watchdog timer references from /etc/systemd/system.conf to get rid of the busy issue on the systemd busy system.

If you're feeling bold, you can kill -9 your wd_keepalive PID, then echo your character toward the /dev/watchdog device, if you want to manually control the watchdog. I prefer just letting the daemon do its thing.

Watchdog setup that works on Pi running Stretch 12/17/18

Unlike some other suggestions on SO and the net, I did not need to install watchdog as a device on the Pi e.g. in /boot/config.txt. Nor did I need to call any services other than via systemctl. I just ran

sudo apt-get install watchdog
sudo update-rc.d watchdog defaults

Then to configure watchdog I put these lines in /etc/watchdog.conf

watchdog-device = /dev/watchdog

# Set default Timeout
watchdog-timeout         = 14

Running Watchdog

Then the only thing I needed to do to use watchdog was call this from my application, which I run after bootup:

sudo systemctl stop watchdog
sudo systemctl enable watchdog
sudo systemctl start watchdog
sudo systemctl -l status watchdog
Kelton Temby
  • 744
  • 9
  • 17