1 |
On Mon, 2008-04-07 at 13:28 -0400, Steven Lembark wrote: |
2 |
> Iain Buchanan wrote: |
3 |
|
4 |
> > watchdogs are nice, and linux makes them ultra-easy to program, but of |
5 |
> > course if your watchdog task dies, then the machine effectively hits the |
6 |
> > reset button for you - no nice shutdown whatsoever! (Which is what you |
7 |
> > want in a hard lock-up, but not if your programming skills are the cause |
8 |
> > of the problem :) |
9 |
> |
10 |
> - Have the system turn off the watchdog if the file is |
11 |
> closed. |
12 |
|
13 |
maybe, maybe not :) I personally like setting CONFIG_WATCHDOG_NOWAYOUT |
14 |
on systems with hardware watchdogs, especially remote unattended |
15 |
systems. Usually your watchdog task never dies on such a system, and |
16 |
when it does (be it from a nice kill or not) you want the watchdog to |
17 |
fire. However if this is a semi-used system (you ssh or log-in to it in |
18 |
any way to do stuff) you may not want this. |
19 |
|
20 |
> - After that just open it and poke a bit out now and |
21 |
> then. |
22 |
> |
23 |
> - Make a point of closing the file on exit. |
24 |
> |
25 |
> #!/usr/bin/perl |
26 |
> |
27 |
> use strict; |
28 |
> |
29 |
> open my $fh, '<', '/path/to/watchdog/file' |
30 |
|
31 |
it's usually /dev/watchdog if you're using the linux kernel interface. |
32 |
|
33 |
I agree that your script is nice and simple, and hence less prone to |
34 |
errors. I coded mine in c++ because I use it not only for a machine |
35 |
type watchdog, but also a task based watchdog that reboots the machine |
36 |
based on certain tasks living or not. Each task has to register with |
37 |
the watchdog server and continually tell the server they're alive, or |
38 |
reboot! But that's a story for another thread... |
39 |
-- |
40 |
Iain Buchanan <iaindb at netspace dot net dot au> |
41 |
|
42 |
Linux - Where do you want to fly today? |
43 |
-- Unknown source |
44 |
|
45 |
-- |
46 |
gentoo-user@l.g.o mailing list |