WDMD(8)

πŸ“¦
version 5.1.1 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– WDMD β€” watchdog multiplexing daemon πŸ’–

okay bestie, sit DOWN, because this one is wdmd from section 8 of the System Manager's Manual, and it's literally the thing that decides whether your machine stays alive or goes night-night πŸ‘‘


✨ NAME ✨

wdmd β€” the watchdog multiplexing daemon 🐢


🌸 SYNOPSIS 🌸

wdmd [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: this daemon opens /dev/watchdog and lets multiple independent sources all get a say in whether each KEEPALIVE actually happens. every single test interval (default is 10 seconds, no cap), the daemon runs a test on every source. if any test fails, the KEEPALIVE does not get done. in the default configuration the watchdog timer will reset your whole system if no KEEPALIVE happens for 60 seconds β€” that's the "fire timeout", and yes it's as dramatic as it sounds πŸ’€. which means if one single test fails 5-6 times in a row, the watchdog fires and resets the system. and with multiple test sources, even fewer separate failures back to back can cause a reset too, like:

T seconds, P pass, F fail
T00: test1 P, test2 P, test3 P: KEEPALIVE done
T10: test1 F, test2 F, test3 P: KEEPALIVE skipped
T20: test1 F, test2 P, test3 P: KEEPALIVE skipped
T30: test1 P, test2 F, test3 P: KEEPALIVE skipped
T40: test1 P, test2 P, test3 F: KEEPALIVE skipped
T50: test1 F, test2 F, test3 P: KEEPALIVE skipped
T60: test1 P, test2 F, test3 P: KEEPALIVE skipped
T60: watchdog fires, system resets

(depending on timings, the system may actually be reset sometime shortly before T60, and the tests at T60 would not even get run πŸ™ˆ)

a crucial aspect of the design and function of wdmd is that if any single source does not pass the test for the length of the fire timeout, the watchdog is guaranteed to fire, regardless of whether other sources on the system passed or failed. and yeah, a spurious reset caused by the combined effects of multiple failing tests like the example above? that's an accepted side effect. no cap. it's giving "by design, bestie" πŸ’…

the wdmd init script will load the softdog module if no other watchdog module has been loaded.

🚨 real talk: wdmd cannot be used on a system that has any other program needing to open /dev/watchdog, e.g. watchdog(8). one watchdog at a time, bestie, it's not that kind of party.

🧚 Test Source: clients

using libwdmd, programs connect to wdmd via a unix socket, and send regular messages to wdmd to update an expiry time for their connection. every test interval, wdmd checks whether the expiry time for a connection has been reached. if it has, the test for that client fails. periodt.

πŸ“ Test Source: scripts

wdmd will run scripts from a designated directory every test interval. if a script exits with 0, the test is considered a success β€” otherwise it's a failure. and if a script does not exit by the end of the test interval? considered a failure too. harsh but fair ✨


πŸŽ€ OPTIONS πŸŽ€

  • --version, -V β€” print version. the classic.
  • --help, -h β€” print usage.
  • --dump, -d β€” print debug information from the daemon.
  • --probe, -p β€” print the path of a functional watchdog device. exit code 0 means a functional device was found; exit code 1 means a functional device was not found.
  • -D β€” enable debugging to stderr and don't fork. (yes, it stays in the foreground, very main character of it)
  • -H 0|1 β€” enable (1) or disable (0) high priority features such as realtime scheduling priority and mlockall.
  • -G name β€” group ownership for the socket.
  • -S 0|1 β€” enable (1) or disable (0) script tests.
  • -s path β€” path to scripts dir.
  • -k num β€” kill unfinished scripts after num seconds. πŸ”ͺ
  • -w path β€” the path to the watchdog device to try first.
  • --trytimeout, -t seconds β€” set the timeout for the watchdog device. use this to check for supported timeout values.
  • --forcefire, -F β€” force the watchdog to fire and reset the machine. use with -t.
⚠️ bestie, -F literally resets the machine. like. that's the whole thing it does. use with -t, and maybe with a snack and a prayer 🫢

and that's the whole page!! this one shipped with version dated 2011-08-01, straight from the System Manager's Manual, filed under WDMD(8) β€” a true vintage icon, lowkey iconic, highkey still resetting machines to this day πŸ’œπŸŒΈβœ¨

πŸ“¦ where this page comes from