Package: ulogd2
Version: 2.0.8-3
Severity: important

ulogd2.service fails to start intermittently on boot because it races against 
systemd-tmpfiles-setup.service, which is responsible for creating /run/ulog/ as 
declared in /usr/lib/tmpfiles.d/ulogd2.conf.

When ulogd2 wins the race, /run/ulog/ does not yet exist. The daemon itself 
starts successfully (plugins load, UID/GID change completes) but cannot write 
/run/ulog/ulogd.pid. Since the unit uses Type=forking with 
PIDFile=/run/ulog/ulogd.pid, systemd waits the full TimeoutStartSec (90s) for 
the PID file to appear, then marks the service failed:

   ulogd2.service: Failed to parse PID from file /run/ulog/ulogd.pid: Invalid 
argument
   ulogd2.service: start operation timed out. Terminating.
   ulogd2.service: Failed with result 'timeout'.

 A manual `systemctl restart ulogd2` always succeeds as /run/ulog/ exists by 
that point.

 Suggested fix (either of):
   1. Add to [Unit]: After=systemd-tmpfiles-setup.service
   2. Or better: replace the tmpfiles.d entry with RuntimeDirectory=ulog in the 
[Service] section,  systemd then creates /run/ulog/ before starting the daemon, 
eliminating the race entirely.

Reply via email to