Packages: check and create unit user on each post-script invocation.

This commit is contained in:
Konstantin Pavlov
2020-12-22 12:57:24 +03:00
parent 03436d2ec2
commit 65295c8141

View File

@@ -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
----------------------------------------------------------------------