From 0458cf5bd7a7a6ad502969636073fe2f5f39166e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Dec 2016 18:14:11 +0100 Subject: [PATCH] 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. --- bus/Makefile.am | 6 ++++++ bus/dbus.conf.in | 5 +++++ configure.ac | 1 + 3 files changed, 12 insertions(+) create mode 100644 bus/dbus.conf.in diff --git a/bus/Makefile.am b/bus/Makefile.am index 268c6f0..5c23939 100644 --- a/bus/Makefile.am +++ b/bus/Makefile.am @@ -1,6 +1,7 @@ dbusdatadir=$(datadir)/dbus-1 legacydbusdatadir=$(sysconfdir)/dbus-1 dbus_daemon_execdir = $(DBUS_DAEMONDIR) +systemdsysusersdir = $(libdir)/sysusers.d DBUS_BUS_LIBS = \ $(CODE_COVERAGE_LDFLAGS) \ @@ -46,6 +47,7 @@ CONFIG_IN_FILES= \ org.freedesktop.dbus-session.plist.in \ example-system-enable-stats.conf.in \ example-session-disable-stats.conf.in \ + dbus.conf.in $(NULL) dbusdata_DATA = session.conf @@ -316,11 +318,15 @@ SCRIPT_IN_FILES += \ dbus.socket.in \ systemd-user/dbus.service.in \ systemd-user/dbus.socket.in \ + dbus.conf \ $(NULL) systemdsystemunit_DATA = \ dbus.service \ dbus.socket + +nodist_systemdsysusers_DATA = \ + dbus.conf endif if DBUS_ENABLE_USER_SESSION diff --git a/bus/dbus.conf.in b/bus/dbus.conf.in new file mode 100644 index 0000000..fb35702 --- /dev/null +++ b/bus/dbus.conf.in @@ -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" diff --git a/configure.ac b/configure.ac index 71a0855..87f6c3a 100644 --- a/configure.ac +++ b/configure.ac @@ -1876,6 +1876,7 @@ bus/dbus.service bus/dbus.socket bus/systemd-user/dbus.service bus/systemd-user/dbus.socket +bus/dbus.conf Makefile dbus/Makefile bus/Makefile -- 2.7.4