summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2020-12-22 12:57:24 +0300
committerKonstantin Pavlov <thresh@nginx.com>2020-12-22 12:57:24 +0300
commit65295c81413cff75eddef2845f09159711e553df (patch)
treede0417e9c8c4fd138903ab52fa3c037732cd3509 /pkg/rpm
parent03436d2ec2ab485b4f3196690e9a267bf0d42d30 (diff)
downloadunit-65295c81413cff75eddef2845f09159711e553df.tar.gz
unit-65295c81413cff75eddef2845f09159711e553df.tar.bz2
Packages: check and create unit user on each post-script invocation.
Diffstat (limited to 'pkg/rpm')
-rw-r--r--pkg/rpm/unit.spec.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in
index 15853cf1..08db73e2 100644
--- a/pkg/rpm/unit.spec.in
+++ b/pkg/rpm/unit.spec.in
@@ -144,11 +144,11 @@ cat /dev/null > debugsourcefiles.list
%{__rm} -rf %{buildroot}
%post
+getent group unit >/dev/null || groupadd -r unit
+getent passwd unit >/dev/null || \
+ useradd -r -g unit -s /sbin/nologin \
+ -d /nonexistent -c "unit user" unit
if [ $1 -eq 1 ]; then
- getent group unit >/dev/null || groupadd -r unit
- getent passwd unit >/dev/null || \
- useradd -r -g unit -s /sbin/nologin \
- -d /nonexistent -c "unit user" unit
/usr/bin/systemctl preset unit.service >/dev/null 2>&1 ||:
cat <<BANNER
----------------------------------------------------------------------