watchdog complains with the comment:
cannot open /var/run/rsyslogd.pid (errno = 2 = 'No such file or directory)
and causes a reboot.
When I create this file manually (touch /var/run/rsyslogd.pid) immediately after booting it works perfect. But this file will get lost with the next reboot . I expected watchdog to run as root via systemd and root should be able to create this file by itself. Isn’t it?
ls -la /var
insgesamt 328752
...
lrwxrwxrwx 1 root root 4 Jun 20 2017 run -> /run
...
Any hint helping to solve this problem is very much appreciated.
Thank you
systemctl status watchdog.service
● watchdog.service - watchdog daemon
Loaded: loaded (/lib/systemd/system/watchdog.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-05-27 12:23:38 CEST; 19s ago
Process: 511 ExecStartPre=/bin/sh -c [ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module (code=exited, status=0/SUCCESS)
Process: 514 ExecStart=/bin/sh -c [ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options (code=exited, status=0/SUCCESS)
Main PID: 516 (watchdog)
Memory: 448.0K
CGroup: /system.slice/watchdog.service
└─516 /usr/sbin/watchdog -s -v -c /etc/watchdog.conf
Mai 27 12:23:45 charon watchdog[516]: still alive after 5 interval(s)
Mai 27 12:23:47 charon watchdog[516]: cannot open /var/run/rsyslogd.pid (errno = 2 = 'No such file or directory')
Mai 27 12:23:47 charon watchdog[516]: Retry at 9 seconds for /var/run/rsyslogd.pid
Mai 27 12:23:48 charon watchdog[516]: still alive after 6 interval(s)
Mai 27 12:23:50 charon watchdog[516]: cannot open /var/run/rsyslogd.pid (errno = 2 = 'No such file or directory')
Mai 27 12:23:50 charon watchdog[516]: Retry at 12 seconds for /var/run/rsyslogd.pid
Mai 27 12:23:51 charon watchdog[516]: still alive after 7 interval(s)
Mai 27 12:23:55 charon watchdog[516]: cannot open /var/run/rsyslogd.pid (errno = 2 = 'No such file or directory')
Mai 27 12:23:55 charon watchdog[516]: Retry at 17 seconds for /var/run/rsyslogd.pid
Mai 27 12:23:56 charon watchdog[516]: still alive after 8 interval(s)
I did a fresh install of the latest dietpi on odroid c2 and also did an update and an upgrade, too.
The board should be used as an headless system and therefore I installed and activated the watchdog
with the module gxbb_wd.
cat /etc/default/watchdog
# Start watchdog at boot time? 0 or 1
run_watchdog=1
# Start wd_keepalive after stopping watchdog? 0 or 1
run_wd_keepalive=1
# Load module before starting watchdog
watchdog_module=gxbb_wdt
# Specify additional watchdog options here (see manpage).
watchdog_options="-s -v -c /etc/watchdog.conf"
cat /etc/watchdog.conf
# Defaults compiled into the binary
#admin = root
interval = 1
logtick = 1
log-dir = /var/log/watchdog
# This greatly decreases the chance that watchdog won't be scheduled before
# your machine is really loaded
realtime = yes
priority = 1
# Check if rsyslogd is still running by enabling the following line
pidfile = /var/run/rsyslogd.pid
watchdog-timeout = 15