From 2576d00a46f0a4d3157544e72aad5fd9e78504a7 Mon Sep 17 00:00:00 2001
From: Olivier Benz <olivier.benz@b-data.ch>
Date: Fri, 31 Jan 2025 07:23:29 +0100
Subject: [PATCH] Update script start.sh

- Do not add to default group when run with rootless triplet
- https://github.com/b-data/jupyterlab-r-docker-stack/issues/5
---
 base/scripts/usr/local/bin/start.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/base/scripts/usr/local/bin/start.sh b/base/scripts/usr/local/bin/start.sh
index 4e3f0b4..7ecafe5 100755
--- a/base/scripts/usr/local/bin/start.sh
+++ b/base/scripts/usr/local/bin/start.sh
@@ -116,8 +116,8 @@ if [ "$(id -u)" == 0 ]; then
         userdel "${NB_USER}"
         useradd --no-log-init --home "/home/${NB_USER}${DOMAIN:+@$DOMAIN}" --shell "$(which zsh)" --uid "${NB_UID}" --gid "${NB_GID}" --groups 100 "${NB_USER}"
     else
-        # Otherwise, and if not the jovyan user, add it to the default group
-        if [[ "${NB_USER}" != "jovyan" ]]; then
+        # Otherwise, and if not jovyan or root, add it to the default group
+        if [[ "${NB_USER}" != "jovyan" && "${NB_USER}" != "root" ]]; then
             usermod -a -G 100 "${NB_USER}"
         fi
     fi
-- 
GitLab