Linux Watchdog Daemon - Command Line

Back to PSC's home page
Back to Watchdog


The daemon supports several command line options, normally these are used only for test & debugging.

However, it is possible to specify command line settings for the daemon for the normal start by editing either the main script /etc/init.d/watchdog (not recommended) or the include file /etc/default/watchdog (suggested way) to add/modify the line:

watchdog_options=""

The following table lists the supported options. These details are also covered by the man page, for example: http://linux.die.net/man/8/watchdog

Long Option
Short Option
Description
--config-file
-c
This specifies an alternative path/name for the configuration file (the default is /etc/watchdog.conf). Typically used for testing, for example with:

watchdog --config-file test.conf

--force
-f
This overrides some of the tests, specifically for sensible configuration parameters, and the PID file test/open (used to make sure only one instance of the daemon is running).

The PID file will fail if testing as an ordinary user (as /var/run is only writeable by root) so this option is needed for such a test.
--foreground
-F
This prevents daemonization so the watchdog daemon runs in the foreground.

This also results in the daemon continuing to send messages to stderr (as well as syslog), and that any child processes (i.e. test or repair binaries) also have their stdout and stderr sent to the terminal.
--loop-exit
-X
Added (with V6.0 patch #119) to allow testing where the program runs for a fixed number of loops then exits as if sent SIGTERM. Intended for timing CPU load and running memory checking using 'valgrind' and similar cases.
--no-action
-q This flag disables the action on a fault (so no reboot, etc) and is intended only for initial testing as there is no watchdog protection when this is used.

In addition it disables the opening of the watchdog hardware device so an unexpected reset should not occur.

With V5.13 and below, this also disabled the temperature reading as in the past some temperature devices would enable the watchdog as well. With the temperature sensors supported in V6.0+ using the lm-sensors package, this is no longer needed.
--softboot
-b In V5.13 of the watchdog this would enable error returns on 'soft' problems. For example, an error opening a PID file, rather than the PID file referring to a non-existent process.

With V6.0 this has the effect of zeroing the retry-timeout value, so all errors are immediately actioned.

In both cases it makes the watchdog rather "trigger happy" and should be used with caution.
--sync
-s This makes the watchdog daemon call the sync() function on every poll, so the file system is less likely to be damaged by a hardware reset event.

However, this also greatly reduces the file system performance due to the virtual elimination of write caching. Note that the system is rebooted if for any reason the synchronizing lasts longer than the watchdog hardware time-out (default is 60 seconds).
--verbose
-v This increases the verbosity of messages generated by the watchdog daemon.

Originally (e.g. in V5.13) this was a binary (yes/no = true/false) setting and only set by the command line to true.

In V5.15 it supports multiple levels (but only 3 currently used levels), with the configuration file providing a numeric setting (0/1/2 levels, etc) and this option incrementing it. However, using this option twice (or once in addition to the config file) for maximum verbosity leads to a lot of fairly useless messages in syslog intended for software development and debugging, so it is not recommended for normal use.


[top of page]

Last Updated on 26-Aug-2019 by Paul Crawford
Copyright (c) 2014-19 by Paul S. Crawford. All rights reserved.
Email psc(at)sat(dot)dundee(dot)ac(dot)uk
Absolutely no warranty, use this information at your own risk.