gdb - Local mods (compile)
[dragonfly.git] / share / man / man4 / watchdog.4
1 .\"     $OpenBSD: watchdog.4,v 1.11 2009/05/21 16:07:25 mk Exp $
2 .\"
3 .\" Copyright (c) 2004-2006 Michael Knudsen <mk@openbsd.org>
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd October 9, 2009
18 .Dt WATCHDOG 4
19 .Os
20 .Sh NAME
21 .Nm watchdog
22 .Nd hardware timers/counters for quick crash recovery
23 .Sh DESCRIPTION
24 Hardware watchdog timers are devices that reboot the machine when it
25 hangs.
26 The kernel continually resets the watchdog clock on a regular basis.
27 Thus, if the kernel halts, the clock will time out and reset the machine.
28 Watchdog timers may be configured to be reset from userland
29 to cause a reboot if process scheduling fails;
30 see
31 .Xr watchdogd 8
32 for further information.
33 .Pp
34 A number of hardware watchdogs are supported, and all are configured
35 using
36 .Xr sysctl 8
37 under the
38 .Va kern.watchdog
39 name:
40 .Bl -tag -width kern.watchdog.period -offset indent
41 .It Va kern.watchdog.auto
42 Automatically reset
43 .Pq Sq tickle
44 the watchdog timer but disable it at system shutdown time.
45 .It Va kern.watchdog.period
46 The timeout in seconds.
47 Setting it to zero disables the watchdog timer.
48 .El
49 .Pp
50 In situations where the machine provides vital services which are not
51 handled completely in kernel space, e.g. mail exchange, it may be
52 desirable to reboot the machine if process scheduling fails.
53 This is done by setting
54 .Va kern.watchdog.auto
55 to zero and running a process which repeatedly sets
56 .Va kern.watchdog.period
57 to the desired timeout value.
58 Then, if process scheduling fails, the process resetting the timer will
59 not be run, leading to the machine being rebooted.
60 Note that the kernel will not automatically disable an enabled watchdog at
61 system shutdown time when
62 .Va kern.watchdog.auto
63 is set to zero.
64 .Pp
65 Watchdog timers should be used in high-availability environments where
66 getting machines up and running quickly after a crash is more important
67 than determining the cause of the crash.
68 A watchdog timer enables a crashed machine to autonomously attempt to
69 recover quickly after a system failure.
70 .Pp
71 Note that this also means that it is unwise to combine watchdog timers
72 with
73 .Xr ddb 4
74 since the latter may prevent the former from resetting the
75 watchdog timeout before it expires.
76 This means that the machine will be rebooted before any debugging
77 can be done.
78 In other words: For mission critical machines, disable
79 .Xr ddb 4
80 by adding
81 .Cd options DDB_UNATTENDED
82 to the kernel configuration file
83 since this will give the chance to perform a crash dump and reboot.
84 Simply setting the watchdog will lose the debug trace of what went
85 wrong.
86 .Sh SEE ALSO
87 .Xr ddb 4 ,
88 .Xr sysctl.conf 5 ,
89 .Xr config 8 ,
90 .Xr sysctl 8 ,
91 .Xr watchdogd 8
92 .Sh BUGS
93 For systems with multiple watchdog timers available, only a single
94 one can be used at a time.
95 There is currently no way of selecting which device is used; the first
96 discovered by the kernel is selected.