dbus-broker: create user and group if non-existant

Make sure the 'dbus' user and group exist. They used to be created in
the 'dbus-common' package, but that is no longer the case. Instead, we
are supposed to create them in tail packages manually.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
David Herrmann 2018-10-23 15:27:22 +02:00
parent db0a711737
commit 078e198568

View File

@ -1,3 +1,5 @@
%global dbus_user_id 81
Name: dbus-broker
Version: 16
Release: 1%{?dist}
@ -22,6 +24,7 @@ BuildRequires: glibc-devel
BuildRequires: meson
BuildRequires: python3-docutils
Requires: dbus-common
Requires(pre): shadow-utils
%description
dbus-broker is an implementation of a message bus as defined by the D-Bus
@ -43,6 +46,21 @@ recent Linux kernel releases.
%check
%meson_test
%pre
# create dbus user and group
getent group %{dbus_user_id} >/dev/null || \
/usr/sbin/groupadd \
-g %{dbus_user_id} \
-r dbus
getent passwd %{dbus_user_id} >/dev/null || \
/usr/sbin/useradd \
-c 'System message bus' \
-u %{dbus_user_id} \
-g %{dbus_user_id} \
-s /sbin/nologin \
-d '/' \
-r dbus
%post
%systemd_post dbus-broker.service
%systemd_user_post dbus-broker.service
@ -70,6 +88,9 @@ systemctl --no-reload --global preset dbus-broker.service &>/dev/null || :
%{_userunitdir}/dbus-broker.service
%changelog
* Tue Oct 23 2018 David Herrmann <dh.herrmann@gmail.com> - 16-2
- create dbus user and group if non-existant
* Fri Oct 12 2018 Tom Gundersen <teg@jklm.no> - 16-1
- make resource limits configurable
- rerun presets in case dbus-daemon is disabled