Commit ae7568fa authored by Simon McVittie's avatar Simon McVittie

Install a systemd tmpfiles.d snippet to create /var/lib/dbus/machine-id

On systemd systems, /etc/machine-id is guaranteed to exist and has
the same format as the D-Bus machine ID. The major D-Bus implementations
read /etc/machine-id if it exists, but some less up-to-date
implementations still only read /var/lib/dbus/machine-id. We can be
nice to those implementations by ensuring /var/lib/dbus/machine-id
is a symlink; this way, the two files can never get out of sync.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101570
parent 3974aa50
......@@ -37,6 +37,7 @@ config.h.in
*.gcda
*.gcno
tags
/bus/tmpfiles.d/dbus.conf
/dbus-1.*/
/dbus-1.*.tar.*
/lcov.html/
......
......@@ -2,6 +2,7 @@ dbusdatadir=$(datadir)/dbus-1
legacydbusdatadir=$(sysconfdir)/dbus-1
dbus_daemon_execdir = $(DBUS_DAEMONDIR)
# Always lib, even if ${libdir} is lib64 or lib/x86_64-linux-gnu
systemdtmpfilesdir = $(prefix)/lib/tmpfiles.d
systemdsysusersdir = $(prefix)/lib/sysusers.d
DBUS_BUS_LIBS = \
......@@ -317,7 +318,8 @@ SCRIPT_IN_FILES += \
dbus.socket.in \
systemd-user/dbus.service.in \
systemd-user/dbus.socket.in \
sysusers.d/dbus.conf.in
sysusers.d/dbus.conf.in \
tmpfiles.d/dbus.conf.in \
$(NULL)
systemdsystemunit_DATA = \
......@@ -326,6 +328,10 @@ systemdsystemunit_DATA = \
nodist_systemdsysusers_DATA = \
sysusers.d/dbus.conf
nodist_systemdtmpfiles_DATA = \
tmpfiles.d/dbus.conf \
$(NULL)
endif
if DBUS_ENABLE_USER_SESSION
......
# Fields: type; path; mode; uid; gid; age; argument (symlink target)
# 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
......@@ -1883,6 +1883,7 @@ bus/dbus.socket
bus/systemd-user/dbus.service
bus/systemd-user/dbus.socket
bus/sysusers.d/dbus.conf
bus/tmpfiles.d/dbus.conf
Makefile
dbus/Makefile
bus/Makefile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment