From e89c3040b7b850db90704bc3fba0158548a198b9 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Fri, 20 Feb 2026 10:05:41 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20sudo=20from=20happy=20daemon=20?= =?UTF-8?q?start=20=E2=80=94=20startapp.sh=20already=20runs=20as=20app=20u?= =?UTF-8?q?ser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sudo -u failed because the app user is not in sudoers. It was unnecessary anyway: startapp.sh (and init-repo.sh) run as the app user (UID 1000) so happy daemon start already executes as the correct user with the right HOME. Co-Authored-By: Claude Sonnet 4.6 --- scripts/init-repo.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/init-repo.sh b/scripts/init-repo.sh index 45e257b..a3deeb9 100644 --- a/scripts/init-repo.sh +++ b/scripts/init-repo.sh @@ -59,13 +59,12 @@ chown -R "$RUN_UID:$RUN_GID" "$WORKSPACE_DIR" mkdir -p "$HOME" chown "$RUN_UID:$RUN_GID" "$HOME" -# Start Happy Coder daemon as the app user so it can access user credentials -# (running as root means HOME=/root, Claude Code and Happy config would be missing) +# Start Happy Coder daemon. startapp.sh already runs as the app user (UID 1000), +# so no sudo needed — Happy/Claude Code will find credentials in the correct home dir. echo "Starting Happy Coder..." -RUN_USER=$(id -nu "$RUN_UID" 2>/dev/null || echo "user") -sudo -u "$RUN_USER" -E sh -c "cd '$WORKSPACE_DIR' && happy daemon start" \ - || echo "Happy Coder daemon failed to start, continuing anyway..." +cd "$WORKSPACE_DIR" +happy daemon start || echo "Happy Coder daemon failed to start, continuing anyway..." echo "Happy Coder daemon started"