@@ -16,38 +16,54 @@ Introduction
16
16
------------
17
17
18
18
This is a slightly refactored and improved version of the original
19
- watchdogd from [ uClinux-dist] . It was written by Michele d'Amico and
19
+ watchdogd from [ uClinux-dist] [ ] . It was written by Michele d'Amico and
20
20
later adapted to uClinux-dist by Mike Frysinger.
21
21
22
22
23
+ ** Example**
24
+
25
+ watchdogd -d /dev/watchdog2 -a 0.8,0.9 -w 120 -k 30
26
+
27
+ Most WDT drivers only support 120 sec as lowest timeout, but watchdogd
28
+ tries to set 20 sec timeout. Example values above are recommendations
29
+
30
+ watchdogd runs at the default UNIX priority (nice) level.
31
+
32
+
23
33
Usage
24
34
-----
25
35
26
- watchdogd [-fVL] [-w <sec>] [-k <sec>] [-s] [-x [NUM]]
27
-
28
- --foreground, -f Start in foreground, background is default
29
- --external-kick, -x NUM Force external watchdog kick using SIGUSR1
30
- A 'NUM x INTERVAL' delay for startup is given
31
- --logfile, -l FILE Log to FILE when backgrounding, otherwise silent
32
- --syslog, -L Use syslog, even if in foreground
33
- --timeout, -w NUM Set the HW watchdog timeout to NUM seconds
34
- --interval, -k NUM Set watchdog kick interval to NUM seconds
35
- --safe-exit, -s Disable watchdog on exit from SIGINT/SIGTERM
36
- --verbose, -V Verbose operation, noisy output suitable for debugging
37
- --version, -v Display version and exit
38
- --help, -h Display this help message and exit
36
+ watchdogd [-fxLsVvh] [-d /dev/watchdog] [-a WARN,REBOOT] [-w SEC] [-k SEC]
37
+
38
+ Options:
39
+ -d, --device=<dev> Device to use, default: /dev/watchdog
40
+ -f, --foreground Start in foreground (background is default)
41
+ -x, --external-kick[=N] Force external watchdog kick using SIGUSR1
42
+ A 'N x <interval>' delay for startup is given
43
+ -l, --logfile=<file> Log to <file> in background, otherwise silent
44
+ -L, --syslog Use syslog, even if in foreground
45
+ -w, --timeout=<sec> Set the HW watchdog timeout to <sec> seconds
46
+ -k, --interval=<sec> Set watchdog kick interval to <sec> seconds
47
+ -s, --safe-exit Disable watchdog on exit from SIGINT/SIGTERM
48
+ -a, --load-average=<val> Enable load average check <WARN,REBOOT>
49
+ -V, --verbose Verbose, noisy output suitable for debugging
50
+ -v, --version Display version and exit
51
+ -h, --help Display this help message and exit
52
+
53
+ By default, watchdogd opens ` /dev/watchdog ` , attempts to set 20 sec WDT
54
+ timeout and then kicks, in the background, every 10 sec.
39
55
40
56
41
57
Features
42
58
--------
43
59
44
- The watchdogd can be used stand-alone to kick a kernel watchdog at
45
- ` /dev/watchdog ` , or with an external supervisor. The latter must use
46
- ` SIGUSR1 ` to activate external kicks. To force an external supervisor
47
- daemon, use ` --external-kick[=NUM] ` , where NUM is an optional delay
48
- which can be quite useful at system startup. E.g., with ` NUM=3 `
49
- watchdogd will delay the handover three built-in kicks, providing the
50
- external supervisor enough time to start.
60
+ watchdogd can be used stand-alone to kick a kernel ` /dev/ watchdog` , or
61
+ with an external supervisor. The latter must use ` SIGUSR1 ` to activate
62
+ external kicks. Use ` --external-kick[=NUM] ` to force an external
63
+ supervisor daemon, where NUM is an optional delay which can be quite
64
+ useful at system startup. E.g., with ` NUM=3 ` watchdogd will delay the
65
+ handover three built-in kicks, providing the external supervisor enough
66
+ time to start.
51
67
52
68
An external supervisor often need to lookup the PID to be able to send
53
69
signals, watchdogd stores its PID in ` /var/run/watchdogd.pid ` like any
@@ -57,6 +73,15 @@ To force a kernel watchdog reboot, watchdogd supports `SIGPWR`. What
57
73
it does is to set the WDT timer to the lowest possible value (1 sec),
58
74
close the connection to ` /dev/watchdog ` , and wait for WDT reboot.
59
75
76
+ System load average monitoring can be enabeled with the ` -a 0.8,0.9 `
77
+ command line argument. The two values, separated by a comma, is the
78
+ normalized load level for logging a warning message and issuing a
79
+ reboot, respectively. Normalized means watchdogd does not care how many
80
+ CPU cores your system as online. If the Linux kernel ` /proc/loadavg `
81
+ file shows ` 3.9 3.0 2.5 ` on a four-core CPU, watchdogd will consider
82
+ this as a load of ` 0.98 0.75 0.63 ` , i.e. divided by four. Only the one
83
+ (1) and five (5) minute average values are used.
84
+
60
85
61
86
Operation
62
87
---------
@@ -87,17 +112,23 @@ everywhere. Enable `--verbose` and use `--syslog` a logfile or
87
112
Origin & References
88
113
-------------------
89
114
90
- The [ original code] in uClinux-dist has no license and is available in
115
+ The [ original code] [ ] in uClinux-dist has no license and is available in
91
116
the public domain, whereas this version is distributed under the ISC
92
- license. See the file [ LICENSE] for more on this.
117
+ license. See the file [ LICENSE] [ ] for more on this.
93
118
94
- This project is maintained by [ Joachim Nilsson] collaboratively at
95
- [ GitHub] . Please file a bug reports, clone it, or send pull requests
119
+ This project is maintained by [ Joachim Nilsson] [ ] collaboratively at
120
+ [ GitHub] [ ] . Please file a bug reports, clone it, or send pull requests
96
121
for bug fixes and proposed extensions, or become a co-maintainer by
97
- contacting the main author .
122
+ contacting the maintainer .
98
123
99
124
[ uClinux-dist ] : http://www.uclinux.org/pub/uClinux/dist/
100
125
[ original code ] :
http://www.mail-archive.com/[email protected] /msg04191.html
101
126
[ GitHub ] : http://github.com/troglobit/watchdogd
102
127
[ LICENSE ] : https://github.com/troglobit/watchdogd/blob/master/LICENSE
103
128
[ Joachim Nilsson ] : http://troglobit.com
129
+
130
+ <!--
131
+ -- Local Variables:
132
+ -- mode: markdown
133
+ -- End:
134
+ -->
0 commit comments