systemd: add sysusers.d snippet for booting up with unpopulated /etc

This adds a "sysusers.d" snippet for creating the system user "dbus" at
boot, if it is missing, in order to support stateless systems that boot
up with an empty /etc and need static information for determining which
system users to create.

This is only installed on systemd-based systems.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99162
This commit is contained in:
Lennart Poettering 2016-12-20 18:14:11 +01:00 committed by Simon McVittie
parent f097ac9f8a
commit e8617fbd27
3 changed files with 12 additions and 0 deletions

View file

@ -1,6 +1,8 @@
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
systemdsysusersdir = $(prefix)/lib/sysusers.d
DBUS_BUS_LIBS = \
$(CODE_COVERAGE_LDFLAGS) \
@ -316,11 +318,15 @@ SCRIPT_IN_FILES += \
dbus.socket.in \
systemd-user/dbus.service.in \
systemd-user/dbus.socket.in \
sysusers.d/dbus.conf.in
$(NULL)
systemdsystemunit_DATA = \
dbus.service \
dbus.socket
nodist_systemdsysusers_DATA = \
sysusers.d/dbus.conf
endif
if DBUS_ENABLE_USER_SESSION

View file

@ -0,0 +1,5 @@
# sysusers.d snippet for creating the D-Bus system user automatically
# at boot on systemd-based systems that ship with an unpopulated
# /etc. See sysusers.d(5) for details.
u @DBUS_USER@ - "System Message Bus"

View file

@ -1876,6 +1876,7 @@ bus/dbus.service
bus/dbus.socket
bus/systemd-user/dbus.service
bus/systemd-user/dbus.socket
bus/sysusers.d/dbus.conf
Makefile
dbus/Makefile
bus/Makefile