From de7a2f9be97714b0f2aa7477a2813cf78f45164f Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 24 Mar 2024 19:12:19 +0300 Subject: [PATCH] sysv init: make compatible with absent nogroup --- init.d/sysv/functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.d/sysv/functions b/init.d/sysv/functions index 7a5dd1e..aadbb0b 100644 --- a/init.d/sysv/functions +++ b/init.d/sysv/functions @@ -19,12 +19,14 @@ user_exists() useradd_compat() { # $1 - username - # skip for readonly systems [ -w "/etc" ] && { if exists useradd ; then useradd --no-create-home --system --shell /bin/false $1 elif is_linked_to_busybox adduser ; then + # some systems may miss nogroup group in /etc/group + # adduser fails if it's absent and no group is specified + addgroup nogroup 2>/dev/null # busybox has special adduser syntax adduser -S -H -D $1 elif exists adduser; then