From 00ff4ca4962370fe42d235d170570bc0691d5d09 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Thu, 6 Apr 2023 20:43:22 -0700 Subject: Packages: use groupadd/useradd on Debian-based operating systems. addgroup/adduser will no longer be installed by default in the "minbase". Also, moving to lower-level utilities saves us one runtime dependency. --- pkg/deb/debian/unit.postinst | 9 ++++----- pkg/docker/template.Dockerfile | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'pkg') diff --git a/pkg/deb/debian/unit.postinst b/pkg/deb/debian/unit.postinst index 8aa476b3..44301f2d 100755 --- a/pkg/deb/debian/unit.postinst +++ b/pkg/deb/debian/unit.postinst @@ -25,17 +25,16 @@ BANNER fi if ! getent group unit >/dev/null; then - addgroup --system unit >/dev/null + groupadd --system unit >/dev/null fi if ! getent passwd unit >/dev/null; then - adduser \ + useradd \ --system \ - --disabled-login \ - --ingroup unit \ + --gid unit \ --no-create-home \ --home /nonexistent \ - --gecos "unit user" \ + --comment "unit user" \ --shell /bin/false \ unit >/dev/null fi diff --git a/pkg/docker/template.Dockerfile b/pkg/docker/template.Dockerfile index 99318507..ba3fb650 100644 --- a/pkg/docker/template.Dockerfile +++ b/pkg/docker/template.Dockerfile @@ -54,14 +54,13 @@ RUN set -ex \ && @@RUN@@ \ && mkdir -p /var/lib/unit/ \ && mkdir /docker-entrypoint.d/ \ - && addgroup --system unit \ - && adduser \ + && groupadd --system unit \ + && useradd \ --system \ - --disabled-login \ - --ingroup unit \ + --gid unit \ --no-create-home \ --home /nonexistent \ - --gecos "unit user" \ + --comment "unit user" \ --shell /bin/false \ unit \ && apt-get update \ -- cgit