home Home > News > Linux Hardware Watchdog Setup
Company News, Industry News, News

Linux Hardware Watchdog Setup

Published: Nov 30, 2026

Share:

A Linux hardware watchdog can reset a board when it stops getting keep-alive pings. On a systemd image with a working watchdog driver, PID 1 can open the device and feed the timer during normal operation.

On a gateway in a cabinet, a reboot can save a trip to the site. It can also leave you with a working box and very little evidence of the freeze. Check the timer on the exact Linux image you plan to deploy, and make sure a reboot leaves you something to read.

RK3588 Hardware Watchdog cover with a Rockchip processor and an embedded Linux board
RK3588 processor and embedded Linux board. Hardware illustrations.

Find the watchdog device

Read sysfs first

Linux assigns watchdog numbers when drivers register their devices. On an image with two watchdogs, one can be hardware and the other can be the software timer. Before putting /dev/watchdog0 into a config file, check which one it is.

The watchdog class in sysfs gives you the driver identity, the device path and, where available, its current state and timeout. The upstream RK3588 device tree describes a DesignWare watchdog, for example. Whether it appears in sysfs depends on the device tree and driver in the image that actually boots.

Read the attributes in sysfs first. Opening the character device can arm the timer, and a driver with nowayout enabled can keep it running after the process closes the file.

Terminal · Bash
for node in /sys/class/watchdog/watchdog[0-9]*; do
  [ -d "$node" ] || continue
  printf '\n%s\n' "$node"
  readlink -f "$node/device"
  for field in identity state timeout nowayout bootstatus; do
    if [ -r "$node/$field" ]; then
      printf '%s: ' "$field"
      cat "$node/$field"
    fi
  done
done

If the loop prints nothing, check the kernel log for driver probe errors and look up the watchdog driver required by your board. On an RK3588 image, check the DesignWare driver and the device tree shipped with that image. Switching from a vendor image to another distribution can change both, even on the same physical board.

Top-view illustration of an embedded Linux board with USB and Ethernet ports
Illustration of a generic embedded board.

Configure systemd

Give it one owner

An image can come with its own watchdog daemon. If you have lsof, run sudo lsof /dev/watchdog0 using the device you identified. Check the daemon’s configuration before handing over the timer. A second process can get a busy error while the first one holds it open.

The systemd manager setting is RuntimeWatchdogSec. With a nonzero timeout, PID 1 feeds the timer regularly. This example asks for 30 seconds and selects /dev/watchdog0. Substitute the hardware device you found in sysfs.

Treat the 30 seconds as a request. The hardware may only support certain intervals. Read the active timeout back from sysfs and check it against the longest delay the board needs to tolerate under load.

systemd · INI
[Manager]
RuntimeWatchdogSec=30s
WatchdogDevice=/dev/watchdog0

Test the recovery path

Save the drop-in as /etc/systemd/system.conf.d/60-hardware-watchdog.conf on a spare unit and apply it during a planned reboot. Keep a local console and a way to remove the file if the unit gets stuck. Once it boots, confirm the timer is active. Then verify that a controlled timeout actually resets the board and that the application starts again afterward.

After an unexpected reboot, try journalctl -b -1 -k if the system retains previous boots. Check bootstatus if the driver provides a reset reason. An abrupt reset can cut off the last messages, so a serial console or remote log can help. On a Rockchip board that fails under sustained load, use the RK3588 thermal throttling guide to check temperatures and clocks as well.

Restart a stuck service

A camera process can get stuck waiting for the next frame while PID 1 keeps feeding the watchdog. The board stays up and your feed stays frozen.

Failure to coverSettingExpected action
Host stops feeding the hardware timerRuntimeWatchdogSec=The hardware watchdog can reset the system.
Application stops sending heartbeatsWatchdogSec= plus Restart=on-watchdogsystemd can restart the service, subject to its rate limits.
Late shutdown stalls during a rebootRebootWatchdogSec=The hardware timer can complete the reset.

Set WatchdogSec in the service unit if the application supports sending WATCHDOG=1 notifications. When they stop, systemd can mark that service failed and restart it with Restart=on-watchdog. Check the start-rate limits if you’re testing repeated hangs. A service can hit its restart limit and stay down while the hardware watchdog continues to get fed.

Have the application check for real progress before it sends the heartbeat. A separate timer thread can keep posting perfectly regular pings while the worker that reads the camera is stuck.

Before ordering

If you’re choosing a Rockchip board, compare the RK3588 single-board computer range and check the Rockchip RK3588 processor page for the SoC. Ask for the exact board revision and Linux image, and confirm what the watchdog resets. On a carrier with external peripherals, check whether those peripherals come back cleanly after the system restarts.

Rockchip Embedded Platforms

Build with RK3588

Send your board, Linux image, reset scope and recovery requirements so we can recommend an RK3588 configuration or discuss a custom carrier.

Top-view illustration of the Rockchip RK3588 processor package

FAQ

Is the watchdog already armed at boot?

It depends on the driver, device tree and boot configuration. Some images can boot with a timer already running. Read the state and identify the software responsible for pings before changing anything.

Is RebootWatchdogSec enough?

RebootWatchdogSec covers the late shutdown phase of a reboot. Check RuntimeWatchdogSec for a watchdog you want PID 1 to feed during normal operation.

Can Linux tell me why it rebooted?

Sometimes. Use bootstatus where the driver provides meaningful flags, along with a retained journal or serial log. Verify what a known watchdog reset looks like on your board first.

close_white

Contact US

    Name *

    Email Address *

    Phone

    Your Campany Name

    Message *