Skip to content

Commit 1b6ac7f

Browse files
committed
create the user with the same commands as the postinst/preinstall scripts
1 parent a41b9d4 commit 1b6ac7f

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

build-packages.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,22 @@ fi
6060
group_preexists=0
6161
user_preexists=0
6262

63-
if getent group frankenphp; then
63+
if getent group frankenphp >/dev/null; then
6464
group_preexists=1
6565
else
66-
groupadd -r frankenphp
66+
groupadd --system frankenphp
6767
fi
6868

69-
if getent passwd frankenphp; then
69+
if getent passwd frankenphp >/dev/null; then
7070
user_preexists=1
7171
else
72-
useradd -r -g frankenphp frankenphp
72+
useradd --system \
73+
--gid frankenphp \
74+
--create-home \
75+
--home-dir /var/lib/frankenphp \
76+
--shell /usr/sbin/nologin \
77+
--comment "FrankenPHP web server" \
78+
frankenphp
7379
fi
7480

7581
mkdir -p package/empty

0 commit comments

Comments
 (0)