Can we finally switch to systemd /run directory? /var/run sucks…

Jacek Konieczny jajcus at jajcus.net
Tue Feb 19 09:34:48 CET 2019


Hi,


In PLD various systemd units and tmpfiles configs have been patched to
move from /run to the legacy /var/run for 'backward compatibility', even
though there are good reasons for using /run.

New systemd won't even work well with /var/run:

Feb 19 08:55:04 pbx systemd-tmpfiles[1100]:
[/usr/lib/tmpfiles.d/dbus.conf:1] Line references path below legacy
directory /var/run/, updating /var/run/dbus → /run/dbus; please update
the tmpfiles.d/ drop-in file accordingly.
Feb 19 08:55:04 pbx systemd-tmpfiles[1100]:
[/usr/lib/tmpfiles.d/iproute2.conf:1] Line references path below legacy
directory /var/run/, updating /var/run/netns → /run/netns; please update
the tmpfiles.d/ drop-in file accordingly.
Feb 19 08:55:04 pbx systemd-tmpfiles[1100]:
[/usr/lib/tmpfiles.d/ndisc6.conf:1] Line references path below legacy
directory /var/run/, updating /var/run/rdnssd → /run/rdnssd; please
update the tmpfiles.d/ drop-in file accordingly.
Feb 19 08:55:04 pbx systemd-tmpfiles[1100]:
[/usr/lib/tmpfiles.d/openvpn.conf:1] Line references path below legacy
directory /var/run/, updating /var/run/openvpn → /run/openvpn; please
update the tmpfiles.d/ drop-in file accordingly.
Feb 19 08:55:04 pbx systemd-tmpfiles[1100]:
[/usr/lib/tmpfiles.d/pam.conf:1] Line references path below legacy
directory /var/run/, updating /var/run/console → /run/console; please
update the tmpfiles.d/ drop-in file accordingly.
Feb 19 08:55:04 pbx systemd-tmpfiles[1100]:
[/usr/lib/tmpfiles.d/pam.conf:2] Line references path below legacy
directory /var/run/, updating /var/run/sepermit → /run/sepermit; please
update the tmpfiles.d/ drop-in file accordingly.
Feb 19 08:55:04 pbx systemd-tmpfiles[1100]:
[/usr/lib/tmpfiles.d/radvd.conf:1] Line references path below legacy
directory /var/run/, updating /var/run/radvd → /run/radvd; please update

Feb 19 08:55:14 pbx systemd[1]: Failed to connect to API bus: No such
file or directory
Feb 19 08:55:14 pbx systemd[1]: Failed to connect to system bus: No such
file or directory
Feb 19 08:55:14 pbx systemd[1]: Failed to connect to API bus: No such
file or directory

…and various different errors.

/var/run being stored on a persistent file system has been causing
various trouble even before systemd had been a thing. Many services
wouldn't start after unclean shutdown because of pid or lock files
staying around etc.

The systemd preferred way to handle backward compatibility with the old
/var/run directory is to make /var/run a symlink to /run. I think it is
time to implement this in PLD and make rc-scripts mount tmpfs on /run
too. The bigger problem will be /var/run subdirectories… I have no good
idea how to make this work without systemd and tmpfiles or by
re-implementing tmpfiles in rc-scripts… I wish we could switch to
systemd all together finally.

Jacek


More information about the pld-devel-en mailing list