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:


The following table lists the supported options. These details are also covered by the man page, for example:

Long Option
Short Option
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

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.
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.
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.
-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.
-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.
-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).
-v This increases the verbosity of messages generated by the watchdog daemon.

In V5.13 this is a binary (yes/no) setting and only set by the command line.

In V6.0 supports 3 levels, with the configuration file providing yes/no (1/0 levels) and this option incrementing it. However, using this 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 17-Sep-2013 by Paul Crawford
Copyright (c) 2013 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.