Wireguard watchdog cron errors?

Hi

I used the neat wireguard-watchdog script before to reconnect a remote wireguard peer (router in site-to-site configuration) as during power outages and reboots of the main router caused a need for a reboot of the remote router to re-establish the wireguard tunnel. The wireguard watchdog script completely removed the need for those reboots. But now I get a lot of errors that I didn't get in the 19.07 installation.

I just migrated from 19.07 to 22.03.3. I made a fresh install not using any sysupgrade.
In the Scheduled tasks tab I entered the same wireguard-watchdog line as I had in 19.07 and the same that is in the comments of the /usr/bin/wireguard_watchdog file.

These are the wireguard and related opkg packages I have installed.

kmod-wireguard - 5.10.161-1
luci-app-wireguard - git-23.018.72712-6d712c3
luci-proto-wireguard - git-22.327.45657-14403fe
wireguard-tools - 1.0.20210424-3

This is the contents of /etc/crontabs/root :
* * * * * /usr/bin/wireguard_watchdog

In the System logs i get a lot of those cron job errors for wireguard-watchdog.

Wed Feb  1 23:38:00 2023 cron.err crond[2625]: USER root pid 9098 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 23:39:00 2023 cron.err crond[2625]: USER root pid 9121 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 23:40:00 2023 cron.err crond[2625]: USER root pid 9145 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 23:41:00 2023 cron.err crond[2625]: USER root pid 9168 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 23:42:00 2023 cron.err crond[2625]: USER root pid 9192 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 23:43:00 2023 cron.err crond[2625]: USER root pid 9215 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 23:44:00 2023 cron.err crond[2625]: USER root pid 9238 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 23:45:00 2023 cron.err crond[2625]: USER root pid 9261 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 23:46:00 2023 cron.err crond[2625]: USER root pid 9284 cmd /usr/bin/wireguard_watchdog

Here is the contents of /usr/bin/wireguard_watchdog :
https://pastebin.com/81NBaXYD

The script has execute permissions:

-rwxr-xr-x    1 root     root          2780 Feb  8  2022 wireguard_watchdog

What is the output of uci show system

1 Like

Looks normal to me - just seems you have it running every minute. Mine runs every 15:

root@OpenWrt:~# logread | grep watch
Wed Feb  1 18:00:00 2023 cron.err crond[1476]: USER root pid 23649 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 18:15:00 2023 cron.err crond[1476]: USER root pid 23720 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 18:30:00 2023 cron.err crond[1476]: USER root pid 23792 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 18:45:00 2023 cron.err crond[1476]: USER root pid 23855 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 19:00:00 2023 cron.err crond[1476]: USER root pid 23918 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 19:15:00 2023 cron.err crond[1476]: USER root pid 23989 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 19:30:00 2023 cron.err crond[1476]: USER root pid 24060 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 19:45:00 2023 cron.err crond[1476]: USER root pid 24115 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 20:00:00 2023 cron.err crond[1476]: USER root pid 24178 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 20:15:00 2023 cron.err crond[1476]: USER root pid 24241 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 20:30:00 2023 cron.err crond[1476]: USER root pid 24312 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 20:45:00 2023 cron.err crond[1476]: USER root pid 24540 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 21:00:00 2023 cron.err crond[1476]: USER root pid 24757 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 21:15:00 2023 cron.err crond[1476]: USER root pid 24836 cmd /usr/bin/wireguard_watchdog
Wed Feb  1 21:30:00 2023 cron.err crond[1476]: USER root pid 24899 cmd /usr/bin/wireguard_watchdog
2 Likes

Maybe it exits non zero?

Could redirect std out and err to a file, see if there are any errors.

* * * * * /usr/bin/wireguard_watchdog >> /tmp/watchdog.txt 2>&1

Nevermind, see

a result, BusyBox components (including cron) in syslog write all messages with the error level.

Also

3 Likes

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