chiark / gitweb /
sysusers: add a new RPM macro for creating users directly from data passed in via...
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Aug 2014 00:16:27 +0000 (02:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 Aug 2014 00:16:27 +0000 (02:16 +0200)
This allows encoding users to create directly in %pre, which is
necessary so that files owned by the RPM can be assigned to the right
users/groups.

This new macro does create a redundancy, as user definitions for all
users that shall own files need to to be listed twice, once with this
new macro, and then secondly, in the sysusers file shipped with the
package. But there's little way around that, as the users of this type
need to exist before we install the first file, but we actually want to
ship the user information in a file.

src/core/macros.systemd.in

index 0d5f8949ab52f955adcc265d2d5a7714ce2899fb..333f222de086aa2e5b48341f68c5d82cbc8cf5b9 100644 (file)
@@ -83,6 +83,10 @@ systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
 systemd-sysusers %{?*} >/dev/null 2>&1 || : \
 %{nil}
 
+%sysusers_create_inline() \
+echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \
+%{nil}
+
 %sysctl_apply() \
 @rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
 %{nil}