embedded-linuxsafety-critical

How to remove a message from watchdog when I close /dev/watchdog file


I use a hardware watchdog to monitor an activity of some process and reboot the system in case the process is hanged.

While the system is executing init.d scripts a watchdog utility is running. Later, the process mentioned earlier is taking control over the watchdog so the watchdog utility have to be closed. At this moment I would like to not see any messages about watchdog in my log:

[   72.672542] watchdog: watchdog0: watchdog did not stop!

A watchdog which automatically stops when file is closed is not a real watchdog, so, of course the kernel is built with NOWAYOUT option on purpose.


Solution

  • A direct and crude solution which I've found useful is to make a patch for drivers/watchdog/watchdog_dev.c file to remove the annoying line of code.