watchdog questions

mike at mike at
Wed May 6 02:17:23 UTC 2009

On Tue, 05 May 2009 15:06:59 -0600, in sentex.lists.freebsd.questions
you wrote:

>'watchdog -t <n>' starts a watchdog for n seconds.  Runing watchdog(8) again in
><n seconds, resets the timer.  If 'watchdog -t 0' is run, the kernel disables
>the watchdog.
>watchdogd(8) either runs stat(2) on /etc, or a user-defined cmd (with -e), and
>resets the watchdog only on a zero exit code.
>There's a few things that aren't clear, though:
>How many watchdog timers can be enabled at a given time?  If more than one,
>does a single 'watchdog -t 0' disable all timers?
	A single timer.  If you want to disable the daemon and disarm
it, just kill off the daemon

>Upon timer expiration, can the kernel be configured to do anything OTHER than

Not that I am aware of

>Is it the general idea that watchdog(8) would be run in a script, making sure
>the script doesn't hang?  And that watchdogd(8) is run to ensure the entire
>system doesn't hang?

Yes, that can be done.  One thing we do for some of our embedded
devices is use the watchdog facility as a "safe way to reboot" the
system.  If we detect a state where we should not be in, we do a

 killall -9 watchdogd

... As as way to ensure the device will reboot.  Note, we have
everything mounted ro so we dont have to worry about file system

Does the platform you are using support hardware watchdogs ?


More information about the freebsd-questions mailing list