From 43fe00c1c25bbdf8a59ecc81f1257c99c0cc1410 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 12 Feb 2018 11:59:38 -0800 Subject: [PATCH] Create the weldr user in lorax.spec Only created when lorax-composer is installed, not lorax by itself. --- lorax.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lorax.spec b/lorax.spec index 7b617cb5..ccd1986d 100644 --- a/lorax.spec +++ b/lorax.spec @@ -80,6 +80,9 @@ Summary: Lorax Image Composer API Server BuildRequires: python-flask python-gobject libgit2-glib python2-pytoml python-semantic_version Requires: lorax = %{version}-%{release} +Requires(pre): /usr/bin/getent +Requires(pre): /usr/sbin/groupadd +Requires(pre): /usr/sbin/useradd # From EPEL Requires: python2-pytoml @@ -107,6 +110,10 @@ make docs rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install +%pre composer +getent group weldr >/dev/null 2>&1 || groupadd -r weldr >/dev/null 2>&1 || : +getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin -c "User for lorax-composer" weldr >/dev/null 2>&1 || : + %post composer %systemd_post lorax-composer.service