Installing and Activating Watchdog Service on Raspbian Bullseye

Abstract: Resolves watchdog service failure on Raspbian Bullseye by installing the package, loading the bcm2835_wdt driver, and enabling the systemd unit.

Created: 2026-09-21 by
To install and activate the watchdog service on Raspbian Bullseye, you must first install the watchdog package using the system's package manager. After installation, configure the hardware driver in the /etc/modules-load.d/watchdog.conf file to ensure the kernel module loads at boot. Finally, enable and start the systemd service unit to begin monitoring system health automatically.

Installing the Watchdog Package

The primary step involves retrieving the necessary software from the official repositories. Raspbian Bullseye, based on Debian 11, provides the watchdog utility through its standard package sources. Open a terminal session on your Raspberry Pi and update the local package index to ensure you are getting the latest available version of the software. This helps avoid conflicts with older dependencies that might be cached locally. Run the following command to update your package lists:
sudo apt update
Once the update completes, proceed to install the watchdog daemon. This package contains both the user-space utility for configuring thresholds and the daemon itself. The installation process will resolve any dependent libraries required for communication between the userspace tool and the kernel subsystem. Execute the installation command:
sudo apt install watchdog
During the installation, the system may prompt you to confirm the disk space usage. Accept the default options to complete the download and setup. Once finished, verify that the binary is accessible by checking its version or help output. This confirms that the core application has been correctly placed in your system path.

Configuring the Hardware Driver

The watchdog daemon relies on a specific character device within the Linux kernel to function. On Raspberry Pi devices running Bullseye, this is typically handled by the BCM2835 watchdog driver. If this driver does not load automatically during the boot sequence, the watchdog service will fail to initialize because it cannot find the target hardware interface. You need to explicitly tell the system to load this module at startup. Create a new configuration file in the modules load directory dedicated to this purpose. This approach keeps your custom configurations separate from default system files, making future maintenance easier. Use your preferred text editor to create the configuration file:
sudo nano /etc/modules-load.d/watchdog.conf
Add the name of the module to this file. For most Raspberry Pi models supported by Bullseye, the module name is bcm2835_wdt. Save the file and exit the editor. This single line instructs the initramfs and early boot processes to request the kernel to load the specified driver before other services attempt to access it. Verify that the module is loaded by checking the currently active kernel modules. You can do this by grepping the output of the module list for the watchdog identifier. If the module appears in the list, the driver is successfully active.
lsmod | grep bcm2835_wdt

Activating the Systemd Service

With the package installed and the driver configured, the final step is to manage the lifecycle of the watchdog daemon using systemd. By default, the service might be disabled after installation to prevent interference if no hardware driver is present. You must explicitly enable it so that it starts automatically upon every reboot. Enable the service unit to link it into the boot process. This creates the necessary symbolic links in the systemd directories to ensure execution order. It also allows you to control the service state via standard commands.
sudo systemctl enable watchdog
After enabling, start the service immediately without waiting for a reboot. This allows you to test the configuration right away. Check the status of the service to ensure it is running without errors. A healthy service should show an active (running) state.
sudo systemctl start watchdog
sudo systemctl status watchdog
If the service fails to start, check the journal logs for detailed error messages. Common issues include missing drivers or incorrect permissions, though the previous steps usually resolve these. You can view recent logs using the journalctl command filtered for the watchdog unit.
sudo journalctl -u watchdog -e

Verifying Operation

To confirm that the watchdog is functioning correctly, you can monitor the heartbeat mechanism. The watchdog daemon writes to the device periodically to prevent the system from resetting. If the daemon stops or crashes, the hardware timer expires and triggers a reboot. This behavior protects your Raspberry Pi from hanging processes or kernel panics. You can inspect the current status of the watchdog device through the sysfs interface. Look for the heartbeat value, which indicates how often the daemon pings the hardware. A non-zero value suggests that the daemon is actively keeping the system alive.
cat /sys/class/watchdog/watchdog0/heartbeat
Additionally, you can simulate a failure to test the reset functionality. Stop the watchdog service manually and observe whether the system reboots after the timeout period. This timeout is usually defined in seconds within the configuration file. While testing, ensure you have remote access or physical console access to recover if the system becomes unresponsive. For more information on managing system services, see Run Programs with Elevated Privileges: A Comprehensive Guide.

Frequently Asked Questions

Why does my watchdog service fail to start?

The most common reason is that the hardware driver module is not loaded. Ensure that bcm2835_wdt is listed in /etc/modules-load.d/watchdog.conf and that the module appears in lsmod. Another cause is incorrect permissions on the watchdog device node, which the service account must read and write.

How do I change the watchdog timeout value?

You can modify the timeout by editing the /etc/watchdog.conf file. Uncomment the watchdog-timeout line and set the desired number of seconds. After changing this value, restart the watchdog service for the new setting to take effect immediately.

Can I use watchdog on a Raspberry Pi Zero W?

Yes, the Raspberry Pi Zero W supports the same BCM2835 watchdog hardware as other models in the series. The configuration steps remain identical, provided you are using a compatible operating system image like Raspbian Bullseye that includes the correct kernel modules.

What happens if the watchdog triggers a reset?

If the watchdog daemon stops responding or the system hangs such that the daemon cannot ping the hardware, the physical timer expires. This causes the SoC to perform a hard reset, restarting the entire system. This prevents indefinite freezes but may result in data loss for unsaved work.

Is it safe to run watchdog on a headless server?

It is highly recommended for headless servers where physical access is difficult. The watchdog ensures that the device recovers from software glitches autonomously. However, always ensure you have network access or a serial console to diagnose issues after a reboot occurs.

Tags: Linux Raspbian

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More