WATCHDOG.CONF(5)

πŸ“¦
version 5.16 Β· 2 versions
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ WATCHDOG.CONF(5) ✨ β€” File Formats Manual πŸΆπŸ’–

okay bestie, buckle up, we're doing the watchdog.conf manual page and honestly? it's giving essential reading. this is the config file for the Linux watchdog daemon and it is lowkey the most protective bestie your machine will ever have 🫢


🌸 NAME 🌸

watchdog.conf β€” the configuration file for the watchdog daemon, no cap πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

bestie, this file holds all the configuration options for the Linux watchdog daemon. every single one. so here's the vibe:

  • each option has to live on a line all by itself (one option per line, she's not sharing)
  • comments start with #
  • blanks are ignored β€” except after the = sign
  • an empty text after the = sign disables the feature, as long as that makes sense πŸ’€

✨ OPTIONS ✨

  • interval = <interval> β€” sets the highest possible interval between two writes to the watchdog device. the device gets triggered after each check no matter how long that check took. once all checks are done, watchdog goes to sleep for a full cycle of <interval> seconds. default is 1 second. the kernel drivers typically expect a write command every minute, otherwise the system gets rebooted 😭 so an interval of more than a minute can only be used with the force command-line option [--force | -f]. periodt.
  • logtick = <logtick> β€” if you turn on verbose logging, a message gets written into the syslog or a logfile. cute, yes, but it is not necessary to get a message every single interval β€” that really fills up disk and eats CPU. logtick lets you adjust how many intervals get skipped before a log message is written. so if you use logtick = 60 and interval = 10, only every 10 minutes (600 seconds) does a message get written. this may make the exact time of a crash harder to find, but it greatly reduces disk usage and administrator nerves when you're hunting for one particular syslog entry in between all the watchdog messages πŸ™ˆ
  • max-load-1 = <load1> β€” sets the max allowed load average for a 1 minute span. once this load average is reached, the system is rebooted πŸ’€ default value is 0, which means the load average check is disabled. be careful not to set this too low! to set a value less than the predefined minimal value of 2, you have to use the -f command line option.
  • max-load-5 = <load5> β€” sets the max allowed load average for a 5 minute span. once this load average is reached, the system is rebooted. default value is 3/4*max-load-1. be careful not to set this parameter too low. to set a value less than the predefined minimal value of 2, you have to use the -f command line option.
  • max-load-15 = <load15> β€” sets the max allowed load average for a 15 minute span. once this load average is reached, the system is rebooted. default value is 1/2*max-load-1. be careful not to set this parameter too low. to set a value less than the predefined minimal value of 2, you have to use the -f command line option.
  • min-memory = <minpage> β€” sets the minimal amount of memory that has to stay free. note that this is in memory pages (4kB on x86). default value is 0 pages, which means this test is disabled. the page size is taken from the system include files. the usable memory is computed from MemFree + Buffers + Cached, since buffer and cache use typically expand to use most free memory but the kernel will reclaim this as needed.
NOTE: if this measure gets below a few tens of MB, then the system will page swap aggressively and have poorer file system performance due to the lack of caching. 😬

this is a 'passive' test and works by reading /proc/meminfo.

  • allocatable-memory = <minpage> β€” sets the minimum amount of allocatable memory available on the system. note that this is in pages. default value is 0 pages, which means the test is disabled. as with min-memory, the page size is taken from the system include files. this is an 'active' test and it works by attempting to memory-map a block of the configured size. πŸ‘‘
  • max-swap = <maxpage> β€” sets the maximum amount of swap use. note that this is in memory pages (4kB on x86). default value is 0 pages, which means this test is disabled. often this should be a large portion of available swap, but remember that paging 1GB of swap can take several/tens of seconds 😭 this is a 'passive' test and works by reading /proc/meminfo.
  • watchdog-device = <device> β€” sets the watchdog device name, typically /dev/watchdog. default is to disable keep alive support. this should be tested by running the daemon from the command line before configuring it to start automatically on booting. fr fr, test it first.
  • watchdog-refresh-use-settimeout = <auto|yes|no> β€” refresh the watchdog timer by setting its timeout instead of using a normal watchdog refresh operation. might help if your watchdog trips by itself when the first timeout interval elapses. default is 'auto' for IT87 fix-up, but this can be disabled with 'no' or forced for other modules with 'yes'. iykyk πŸ’…
  • watchdog-refresh-ignore-errors = <yes|no> β€” ignore errors reported by writing to the watchdog device. typically this is used for systems that have broken implementations of the IPMI driver, to avoid a reboot loop. 🫢
  • watchdog-timeout = <timeout> β€” set the watchdog device timeout during startup. if not set, a default is used that should be set to the kernel timer margin at compile time.
  • temperature-sensor = <temp-virtual-file> β€” set the temperature sensor name. this is normally a 'virtual file' under /sys and it contains the temperature in milli-Celsius. usually these are generated by the sensors package, but take care, as device enumeration may not be fixed πŸ‘€ default is to disable temperature checking. multiple sensors can be used by having repeated temperature-sensor entries. due to the enumeration problem, any missing temp sensor is simply ignored and not treated as a reboot trigger.
  • max-temperature = <temp> β€” set the maximal allowed temperature in Celsius. once this temperature is reached, the system is stopped πŸ₯΅ default value is 90 C. watchdog will issue warnings once the temperature increases to 90%, 95% and 98% of this temperature.
  • temp-power-off = <yes|no> β€” set the watchdog action on overheating. the yes option (default) powers the machine off; the no option halts the machine and allows a Ctrl-Alt-Del reboot.
  • file = <filename> β€” set the file name for file mode. this option can be given as often as you like, to check several files. πŸ’–
  • change = <mtime> β€” set the change interval time for file mode. this option always belongs to the active filename β€” that is, when finding a change = line, watchdog assumes it belongs to the most recently read file = line. they don't necessarily have to follow each other directly. but you cannot specify a change = before a file =. the default is to only stat the file and not look for changes. using this feature to monitor changes in /var/log/messages might require some special syslog daemon configuration, e.g. rsyslog needs "$ActionWriteAllMarkMessages on" to be set to make sure the marks are written no matter what. 🌈
  • pidfile = <pidfilename> β€” set the pidfile name for daemon test mode. this option can be given as often as you like, to check several daemons, assuming they write their post-forking PID to the specified files.
  • ping = <ip-addr> β€” set the IPv4 address for ping mode. this option can be used more than once, to check different connections. πŸ¦‹
  • ping-count = <ping-per-interval> β€” set the number of ping attempts in each 'interval' of time. default is 3 and it completes on the first successful ping. ✨
  • interface = <if-name> β€” set the interface name for network mode. this option can be used more than once, to check different interfaces. note it is only possible to check physical interfaces, and not aliased IP interfaces. 🚫
  • test-binary = <testbin> β€” execute the given binary to do some user defined tests.
  • test-timeout = <timeout in seconds> β€” user defined tests may only run for <timeout> seconds. set to 0 for unlimited.
  • repair-binary = <repbin> β€” execute the given binary in case of a problem, instead of shutting down the system. πŸ› οΈ
  • repair-timeout = <timeout in seconds> β€” the repair command may only run for <timeout> seconds. set to 0 for 'unlimited', but note that the hardware timer is not refreshed in this case, so the system will hard-reset at some point. πŸ’€
  • retry-timeout = <timeout in seconds> β€” allow most error conditions to persist for <timeout> seconds. set to 0 for immediate action (like softboot behaviour).
  • repair-maximum = <count> β€” this allows no more than <count> repair attempts against a given fault that report success (i.e. return 0), but fail to clear the fault, before a reboot is initiated anyway. if set to zero, then a repairable fault can always be blocked by a repair program reporting success (the previous daemon behaviour).
  • softboot-option = <yes|no> β€” this acts like the -b / --softboot command line and simply sets the retry timeout to zero.
  • admin = <mail-address> β€” email address to send admin mail to. that is, who shall be notified that the machine is being halted or rebooted. default is 'root'. if you want to disable notification via email, just set admin to an empty string. πŸ“§
  • realtime = <yes|no> β€” if set to yes, watchdog will lock itself into memory so it is never swapped out. main character energy, honestly. πŸ‘‘
  • priority = <schedule priority> β€” set the schedule priority for realtime mode, passed to sched_setscheduler().
  • test-directory = <test directory> β€” set the directory to run user test/repair scripts. default is '/etc/watchdog.d'. see the Test Directory section in watchdog(8) for more information. πŸ“
  • log-dir = <log directory> β€” set the log directory to capture the standard output and standard error from repair-binary and test-binary execution. default is '/var/log/watchdog'.
  • sigterm-delay = <time in seconds> β€” set the time on shut down between first sending SIGTERM to all processes, and then sending SIGKILL. default is 5 seconds, which is generally enough, but systems with large databases or virtual machines might need longer. ⏳
  • verbose = <level> β€” bestie this one overrides the --verbose command line option, like it said "move, i'm driving" πŸ’…. And listen: verbose mode is generally only enabled for debugging, because it creates a lot of syslog chatter, so use this option with consideration, okay? Be mindful. Zero is "normal" operation (quiet) 😌, while 1 is typically used for debugging πŸ”. Values of 2 or more usually generate far too many messages. Like, unhinged amounts. You've been warned, babes.
  • heartbeat-file = <filename> β€” for debugging, this lets a rolling set of status values be kept on disk πŸ«€βœ¨.
  • heartbeat-stamps = <interval> β€” also for debugging, this sets the number of entries in the <heartbeat-file> πŸŽ€.
  • log-killed-pids = <yes|no> β€” okay so this acts like enabling 'verbose' logging, but only for a system reboot, where it enables the logging of the PID values for all processes that are being killed πŸ’€. In this case, the results are written to the killall5.log file in the log directory (if at all possible). It's intended for debugging cases where you would like to know what was running at the point the machine triggered the watchdog, but you don't want syslog filling up with the usual chatter of activity. iykyk β€” targeted tea, not a firehose 🌸.

πŸ“ FILES πŸ“

  • /etc/watchdog.conf β€” the watchdog configuration file, the main character itself πŸ‘‘.
  • /etc/watchdog.d β€” a directory containing test-or-repair commands 🧚. See the Test Directory section in watchdog(8) for more information.

πŸ‘€ SEE ALSO πŸ‘€

  • watchdog(8) β€” go read her, she's iconic 🫢

that's the whole page, bestie!! no cap, you now know watchdog.conf fr fr 🌈✨

this page came from the 4th Berkeley Distribution, dated February 2019, and it's WATCHDOG.CONF(5) β€” so go forth and configure responsibly πŸ’–πŸŽ€πŸ¦‹