From 23ba5c2e35117f9098884a8b150c35e4fcd08696 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Fri, 20 Feb 2026 06:33:40 -0500 Subject: [PATCH] Fix Happy Coder startup: use happy daemon start, create home dir The npm package installs a binary named 'happy', not 'happy-coder'. Use 'happy daemon start' to run it as a background service. Also create $HOME on the PVC if it doesn't exist yet, which was causing git config failures on fresh volumes. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- scripts/init-repo.sh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/scripts/init-repo.sh b/scripts/init-repo.sh index c4af4e6..9b77e41 100644 --- a/scripts/init-repo.sh +++ b/scripts/init-repo.sh @@ -55,23 +55,17 @@ RUN_UID="${USER_ID:-1000}" RUN_GID="${GROUP_ID:-1000}" chown -R "$RUN_UID:$RUN_GID" "$WORKSPACE_DIR" -# Start Happy Coder in background as the app user +# Ensure home directory exists on the PVC (may be absent on a fresh volume) +mkdir -p "$HOME" +chown "$RUN_UID:$RUN_GID" "$HOME" + +# Start Happy Coder daemon echo "Starting Happy Coder..." cd "$WORKSPACE_DIR" -# Create Happy Coder log file -HAPPY_LOG="/tmp/happy-coder.log" -touch "$HAPPY_LOG" -chown "$RUN_UID:$RUN_GID" "$HAPPY_LOG" +happy daemon start -# Start Happy Coder (already running as the correct user via baseimage-gui) -bash -c "cd '$WORKSPACE_DIR' && happy-coder > '$HAPPY_LOG' 2>&1 &" - -# Save PID for monitoring -echo $! > /tmp/happy-coder.pid - -echo "Happy Coder started (PID: $(cat /tmp/happy-coder.pid))" -echo "Logs available at: $HAPPY_LOG" +echo "Happy Coder daemon started" # Export workspace directory for startapp.sh echo "$WORKSPACE_DIR" > /tmp/workspace-dir