Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of writing 'V' to watchdog device file

What does it mean when we do echo V > /dev/watchdog? One article said it can prevent stopping watchdog accidentally. I am not clear about this purpose.

like image 820
nathan Avatar asked Mar 11 '23 14:03

nathan


1 Answers

According to the Kernel documentation this is called the 'Magic Close' feature https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt

Magic Close feature:

If a driver supports "Magic Close", the driver will not disable the
watchdog unless a specific magic character 'V' has been sent to
/dev/watchdog just before closing the file.  If the userspace daemon
closes the file without sending this special character, the driver
will assume that the daemon (and userspace in general) died, and will
stop pinging the watchdog without disabling it first.  This will then
cause a reboot if the watchdog is not re-opened in sufficient time.
like image 103
whh4000 Avatar answered Mar 16 '23 01:03

whh4000