Modify systemd tmpfiles.d snippet to create /var/lib/dbus/
authorChris Lesiak <chris.lesiak@licor.com>
Wed, 10 Jan 2018 21:35:20 +0000 (15:35 -0600)
committerSimon McVittie <smcv@collabora.com>
Thu, 11 Jan 2018 12:36:47 +0000 (12:36 +0000)
This snippet was already attempting to create /var/lib/dbus/machine-id,
but would fail on volatile or stateless systems where /var/lib/dbus/
did not already exist. systemd-tmpfiles automatically creates parent
directories for tmpfiles of type 'd', 'D', etc., but not for files
or symlinks (https://github.com/systemd/systemd/issues/7853).

Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
[smcv: Extended commit message to clarify why we need this]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104577
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit aeebf801f1ab462cba3a174440c09a86d326002a)

bus/tmpfiles.d/dbus.conf.in

index 754f022..664d53a 100644 (file)
@@ -1,5 +1,9 @@
 # Fields: type; path; mode; uid; gid; age; argument (symlink target)
 
+# Make ${localstatedir}/lib/dbus/
+# Adjust mode and ownership if it already exists.
+d @EXPANDED_LOCALSTATEDIR@/lib/dbus 0755 - - -
+
 # Make ${localstatedir}/lib/dbus/machine-id a symlink to /etc/machine-id
 # if it does not already exist
 L @EXPANDED_LOCALSTATEDIR@/lib/dbus/machine-id - - - - /etc/machine-id