From 9176f0dc1e5bcd1b7a4deeab5e3c7edd986a92eb 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 | 5 +++++ bus/sysusers.d/dbus.conf.in | 5 +++++ configure.ac | 1 + 3 files changed, 11 insertions(+) create mode 100644 bus/sysusers.d/dbus.conf.in diff --git a/bus/Makefile.am b/bus/Makefile.am index 268c6f0..d4da0c3 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 = $(prefix)/lib/sysusers.d DBUS_BUS_LIBS = \ $(CODE_COVERAGE_LDFLAGS) \ @@ -316,11 +317,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 diff --git a/bus/sysusers.d/dbus.conf.in b/bus/sysusers.d/dbus.conf.in new file mode 100644 index 0000000..fb35702 --- /dev/null +++ b/bus/sysusers.d/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..c7c762e 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/sysusers.d/dbus.conf Makefile dbus/Makefile bus/Makefile -- 2.7.4