What is a watchdog process?

What is a watchdog process?

A watchdog timer (sometimes called a computer operating properly or COP timer, or simply a watchdog) is an electronic or software timer that is used to detect and recover from computer malfunctions. During normal operation, the computer regularly restarts the watchdog timer to prevent it from elapsing, or “timing out”.

What happens when a watchdog timer runs out?

When the watchdog expires, the hardware will immediately reset the system. An interrupt can be enabled which will fire when the watchdog timer is getting close to expiration. In the interrupt handler, the software can decide to “feed” the watchdog to prevent the system from resetting.

How is watchdog used to keep a machine running?

Watchdog is a daemon / subsystem used to monitor the basic health of a machine. If something goes wrong, such as a crashing program overloading the CPU, or no more free memory on the system, watchdog can safely reboot the machine, allowing your service to keep on going rather than wait for someone to come kick the machine.

What do I need to know about watchdog?

Watchdog has a list of options that for what it can monitor. These include: Ping a host, showing that network in reachable. Check if a file been modified since x minutes, such as the logs showing that there is system activity Verify the load under a set amount. If memory can be allocated. If not, programs won’t start / will crash.

Is there a maximum timeout for the watchdog?

On some microcontrollers the built-in watchdog has a maximum timeout on the order of a few hundred milliseconds. It you decide that you want more time, you need to multiply that in software. Say the hardware provides a 100ms timeout, but your policy says that you only want to check the system for sanity every 300ms.

What does watchdog do when you Reboot Your Computer?

Watchdog is careful about the reboot. When it reboots the machine, it does so in a controlled matter. No sudden reboot. It kills processes, syncs the disks, unmounts the filesystems, and otherwise does a full reboot like the system normally would.