watchdog

package
v0.1.0-proto2k Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package watchdog keeps a hardware (or software) watchdog timer fed (GAPI-DIV-027): if the supervisor hangs, the kicks stop and the device resets the machine. A deliberate stop performs the magic close ('V') so the device disarms instead of firing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watchdog

type Watchdog struct {
	// contains filtered or unexported fields
}

Watchdog is one open keepalive device.

func Open

func Open(device string, interval time.Duration) (*Watchdog, error)

Open opens the watchdog device (injectable path; /dev/watchdog on hardware). The kick interval must be well below the device timeout.

func (*Watchdog) Close

func (w *Watchdog) Close() error

Close disarms the device (magic close) and releases it.

func (*Watchdog) Kick

func (w *Watchdog) Kick() error

Kick resets the device timer.

func (*Watchdog) Run

func (w *Watchdog) Run(ctx context.Context)

Run kicks on the interval until ctx ends, then magic-closes. The supervisor health loop owns ctx: a hung supervisor stops kicking, which is the point.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL