# Watchdog on DietPi / RaspberryPi Zero

**URL:** <https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472>\
**Category:** General Discussion\
**Tags:** raspberry-pi-4\
**Created:** [8 January 2025 20:24 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472 "2025-01-08T20:24:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![psychoquaker](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@psychoquaker](https://dietpi.com/forum/u/psychoquaker)\
**Post date:** [8 January 2025 20:24 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/1 "2025-01-08T20:24:08Z")

</div>

Hello  
I tried to activate the watchdog on my system like shown here:

> **[Watchdog: reboot Raspberry Pi if network is down](https://defgw.wordpress.com/2017/10/24/watchdog-reboot-raspberry-pi-if-network-is-down/)**
>
> Network down! Help! I have an issue with one of my Raspberry Pis. It will not survive if Wi-Fi network is down for an extended period of time. I have not been able to figure out the root cause, or …

When I start the watchdog service I get the following errors

```auto
Jan 08 21:13:14 DietPi systemd[1]: Starting watchdog daemon...
Jan 08 21:13:15 DietPi watchdog[857]: unknown protocol icmp
Jan 08 21:13:15 DietPi sh[857]: watchdog: unknown protocol icmp
Jan 08 21:13:15 DietPi systemd[1]: watchdog.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Jan 08 21:13:15 DietPi systemd[1]: watchdog.service: Control process exited, code=exited, status=1/FAILURE
Jan 08 21:13:15 DietPi systemd[1]: watchdog.service: Failed with result 'exit-code'.
Jan 08 21:13:15 DietPi systemd[1]: Failed to start watchdog daemon.
Jan 08 21:13:15 DietPi systemd[1]: watchdog.service: Triggering OnFailure= dependencies.

```

Can you help me?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [8 January 2025 23:23 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/2 "2025-01-08T23:23:05Z")

</div>

> [@psychoquaker](#):
>
> ```auto
> watchdog: unknown protocol icmp
> 
> ```

Can you share the service configuration. And maybe you would need to install packages like `iputils-ping`

---

<div class="post-metadata">

**Author:** ![psychoquaker](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@psychoquaker](https://dietpi.com/forum/u/psychoquaker)\
**Post date:** [9 January 2025 20:58 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/3 "2025-01-09T20:58:36Z")

</div>

here’s my configuration:

[watchdog.conf.txt](https://dietpi.com/forum/uploads/short-url/acQb05eZGNeUe9FvwBe3FUTUAfx.txt) (5.9 KB)

iputils-ping was already installed…

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [10 January 2025 04:42 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/4 "2025-01-10T04:42:54Z")

</div>

`ping` and `ping-count` are commented in your config 🤔.

Does this work?

```sh
ping 192.168.178.1

```

---

<div class="post-metadata">

**Author:** ![psychoquaker](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@psychoquaker](https://dietpi.com/forum/u/psychoquaker)\
**Post date:** [10 January 2025 08:34 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/5 "2025-01-10T08:34:23Z")

</div>

You are right. The configuration which lead to the errors was this one.  
The ping count I did not change (but I tested it also with and without - same result).

[watchdog.conf.txt](https://dietpi.com/forum/uploads/short-url/86bcTXdqIcUrj86MsCLbTGI7DbW.txt) (5.9 KB)

---

<div class="post-metadata">

**Author:** ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)\
**Post date:** [10 January 2025 11:21 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/6 "2025-01-10T11:21:09Z")

</div>

Run this and restart watchdog

```auto
cat << EOF >> /etc/default/watchdog
watchdog_options="ping"
EOF
systemctl restart watchdog.service

```

---

<div class="post-metadata">

**Author:** ![psychoquaker](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@psychoquaker](https://dietpi.com/forum/u/psychoquaker)\
**Post date:** [10 January 2025 18:47 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/7 "2025-01-10T18:47:15Z")

</div>

This did not change anything. The error message stays the same.

BTW: why are there two configuration files for the watchdog?

---

<div class="post-metadata">

**Author:** ![psychoquaker](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@psychoquaker](https://dietpi.com/forum/u/psychoquaker)\
**Post date:** [10 January 2025 18:48 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/8 "2025-01-10T18:48:59Z")

</div>

just executing ping like this:  
ping 192.168.178.1

works fine… so very strange why the watchdog cannot execute it…

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [10 January 2025 19:35 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/9 "2025-01-10T19:35:13Z")

</div>

Pls can you share watchdog `systemd` definition

---

<div class="post-metadata">

**Author:** ![psychoquaker](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@psychoquaker](https://dietpi.com/forum/u/psychoquaker)\
**Post date:** [10 January 2025 19:58 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/10 "2025-01-10T19:58:06Z")

</div>

can you tell me how to do this?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [10 January 2025 20:19 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/11 "2025-01-10T20:19:52Z")

</div>

```auto
systemctl cat watchdog.service

```

---

<div class="post-metadata">

**Author:** ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)\
**Post date:** [10 January 2025 20:26 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/12 "2025-01-10T20:26:53Z")

</div>

That’s strange. I tried to run it on my raspberry and I had the same issue with you. But it was fixed by enabling the ping in the watchdog options.

> [@psychoquaker](#):
>
> BTW: why are there two configuration files for the watchdog?

The `defaults` is not exactly a configuration file.

---

<div class="post-metadata">

**Author:** ![psychoquaker](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@psychoquaker](https://dietpi.com/forum/u/psychoquaker)\
**Post date:** [12 January 2025 18:42 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/13 "2025-01-12T18:42:01Z")

</div>

Here’s the output:

```auto
# /lib/systemd/system/watchdog.service
[Unit]
Description=watchdog daemon
Conflicts=wd_keepalive.service
After=multi-user.target
OnFailure=wd_keepalive.service

[Service]
Type=forking
EnvironmentFile=/etc/default/watchdog
ExecStartPre=/bin/sh -c '[-z "${watchdog_module}"] || ["${watchdog_module}" = "none"] || /sbin/modprobe $watchdog_module'
ExecStart=/bin/sh -c '[$run_watchdog != 1] || exec /usr/sbin/watchdog $watchdog_options'
ExecStopPost=/bin/sh -c '[$run_wd_keepalive != 1] || false'

[Install]
WantedBy=default.target

```

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 January 2025 13:23 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/14 "2025-01-16T13:23:07Z")

</div>

did a test on RP4B facing the same issue, while it was working fine on a x64 VM. interesting 🤔

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [16 January 2025 13:38 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/15 "2025-01-16T13:38:21Z")

</div>

Does it probably require logind?

```sh
systemctl unmask systemd-logind
apt install dbus
systemctl start systemd-logind

```

Such a dependency for a watchdog would not be exactly helpful, when e.g. logind hangs (as well), but who knows. systemd added it as dependency for quite a bunch of features with Bookworm (the related systemd version).

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 January 2025 13:51 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/16 "2025-01-16T13:51:48Z")

</div>

> [@MichaIng](#):
>
> Does it probably require logind?

nope, doesn’t change anything

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [16 January 2025 14:15 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/17 "2025-01-16T14:15:59Z")

</div>

To rule out the systemd unit: when stipping the service, and running `watchdog` from console with the arguments/options from `/etc/default/watchdog, does it work? Ah hence just `watchdog ping`.

Ahh wait a second, this cannot work. The `watchdog_options` are added as arguments just like that according to the systemd unit, and `ping` is no valid argument @trendy. There is no command-line argument to define the ping method. Instead one can set it e.g. to `-c /etc/watchdog.conf` to define the config file. That however is the default. So best to keep the `watchdog_options` variable commented in `/etc/default/watchdog`.

The command to test one console is hence reallt just `watchdog`, which then uses mentioned config file, just like the systemd service should do by default.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 January 2025 14:20 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/18 "2025-01-16T14:20:54Z")

</div>

> [@MichaIng](#):
>
> The command to test one console is hence reallt just `watchdog`

```auto
root@DietPiM6:~# watchdog
watchdog: unknown protocol icmp
root@DietPiM6:~#

```

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [16 January 2025 14:26 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/19 "2025-01-16T14:26:34Z")

</div>

Okay very weird. I will run some tests when I am back home in a day.

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [15 July 2025 14:26 UTC](https://dietpi.com/forum/t/watchdog-on-dietpi-raspberrypi-zero/22472/20 "2025-07-15T14:26:55Z")

</div>

Closed on 15 July 2025 14:26 UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
