Systemd logs warnings about the legacy tmpfile location /var/run
Environment
- Red Hat Enterprise Linux 8
- Systemd version
systemd-239and above -
And any package referencing
/var/run. Note the following package list includes known effected packages but is not limited to the following list;libstoragemgmt-1.6.2-9.el8.x86_64mdadm-4.1-4.el8.x86_64net-snmp-5.8-7.el8.x86_64radvd-2.17-12.el8.x86_64subscription-manager-1.23.8-35.el8.x86_64krb5-libs-1.18.2-8.el8389-ds-base-1.4- IPA
unbound-1.7.3-8.el8certmonger
Issue
-
Every time the
systemd-tmpfiles-clean.serviceis started, multiple messages are printed to logs:May 13 17:55:57 rhel8 systemd[1]: Starting Cleanup of Temporary Directories... May 13 17:55:57 rhel8 systemd-tmpfiles[31007]: [/usr/lib/tmpfiles.d/<PACKAGE NAME>.conf:1] Line references path below legacy directory /var/run/, updating /var/run/<PATH> → /run/<PATH>; please update the tmpfiles.d/ drop-in file accordingly.
Resolution
Note The message is informational and should not indicate any failure of operations.
- Due to the systemd change, any package using
/var/runwill need to be updated to attempt to remove the logs. -
The following is a non-comprehensive list of packages and their errata with updates addressing the logs;
libstoragemgmtRHBA-2019:3629mdadmRHBA-2020:1890net-snmpRHBA-2020:1817radvdRHBA-2020:1602subscription-managerRHBA-2020:4460certmongerRHBA-2020:4671freeradiusRHSA-2020:4799
-
To determine which package provides the
/var/run/<FILE>/location, running the following command will provide a list of all packages which provide the noted file wherein an update may be performed to determine if the warning no longer occurs after the update;# dnf whatprovides /var/run/<FILE>/ # dnf whatprovides /var/run/rhsm # this is an example and should list the subscription-manager package
Workaround
-
The following command could be used as a temporary workaround. It would create corresponding configuration files under
/etc/tmpfiles.d/*with a correct path:# sed "s/\/var\/run\//\/run\//g" /usr/lib/tmpfiles.d/<PACKAGE NAME>.conf > /etc/tmpfiles.d/<PACKAGE NAME>.conf-
The following example changes the configurations for the
pesignpackage:# systemctl restart systemd-tmpfiles-clean.service # reproduces the logs # journalctl -a -b 0 | grep 'Line references' # find the warning log Sep 10 13:46:46 r8 systemd-tmpfiles[738]: [/usr/lib/tmpfiles.d/pesign.conf:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop-in file accordingly. # sed "s/\/var\/run\//\/run\//g" /usr/lib/tmpfiles.d/pesign.conf > /etc/tmpfiles.d/pesign.conf # change the config # systemctl restart systemd-tmpfiles-clean.service # reproduces the logs if not changed # journalctl -a -b 0 | grep 'Line references' # we only see the prior log and not a new one! Sep 10 13:46:46 r8 systemd-tmpfiles[738]: [/usr/lib/tmpfiles.d/pesign.conf:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop-in file accordingly. -
Consider deleting of the configuration file
/etc/tmpfiles.d/<PACKAGE NAME>.confafter corresponding erratas would be published for the required package if the workaround was implemented in the target environment.
-
Root Cause
- The upstream github systemd commit introduced a notice-level log warning about the use of
/var/runfor tmpfiles while also fixing up conflicts with how tmpfiles merge lines. /var/run/ is indeed a legacy directory due to being fully symlinked to/run`, its use is still valid outside of systemd. As such, nothing breaks.- Many application stacks and packages reference
/var/tmpstill and thus require an update to address the log.
Diagnostic Steps
The issue is easily reproducible with the following steps;
-
Restart
systemd-tmpfiles-clean.service# systemctl restart systemd-tmpfiles-clean.service -
Check the logs afterwards
-
For systems using rsyslog:
# grep "Line references path below legacy directory /var/run/" /var/log/messages May 17 14:54:20 rhel8 systemd-tmpfiles[30687]: [/usr/lib/tmpfiles.d/mdadm.conf:1] Line references path below legacy directory /var/run/, updating /var/run/mdadm → /run/mdadm; please update the tmpfiles.d/ drop-in file accordingly. -
For other systems:
# journalctl -a -b 0 | grep 'Line references' Sep 10 13:46:46 r8 systemd-tmpfiles[738]: [/usr/lib/tmpfiles.d/pesign.conf:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop-in file accordingly.
-
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments