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