From: Lennart Poettering Date: Tue, 19 Aug 2014 00:16:27 +0000 (+0200) Subject: sysusers: add a new RPM macro for creating users directly from data passed in via... X-Git-Tag: v216~36 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=0e77023ea0ce315af6b0c4806b27c0140c91bbc7;hp=dfc87cbfe5ec03190e5b2235b1ed477db11541ca sysusers: add a new RPM macro for creating users directly from data passed in via stdin 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. --- diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in index 0d5f8949a..333f222de 100644 --- a/src/core/macros.systemd.in +++ b/src/core/macros.systemd.in @@ -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}