#1138043 ulogd2: service fails to start on boot due to race with systemd-tmpfiles-setup.service

Package:
ulogd2
Source:
ulogd2
Description:
Netfilter Userspace Logging Daemon
Submitter:
Stedman, Gabriel
Date:
2026-05-27 11:17:02 UTC
Severity:
normal
#1138043#5
Date:
2026-05-27 11:00:01 UTC
From:
To:
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.