fix: remove stale Happy daemon lock file on startup #17

Merged
cpfarhood merged 2 commits from fix/happy-daemon-stale-lock into main 2026-02-20 15:21:53 +00:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit 5d8b1369c3 - Show all commits
+1 -1
View File
@@ -12,7 +12,7 @@ githubRepo: ""
# Happy Coder endpoints # Happy Coder endpoints
happyServerUrl: "https://happy.farh.net" happyServerUrl: "https://happy.farh.net"
happyWebappUrl: "https://happy-coder.farh.net" happyWebappUrl: "https://happy-coder.farh.net"
happyHomeDir: "/home/user/.happy" happyHomeDir: "/workspace/.happy"
happyExperimental: "true" happyExperimental: "true"
# VNC display # VNC display
+4 -3
View File
@@ -63,9 +63,10 @@ chown "$RUN_UID:$RUN_GID" "$HOME"
# so no sudo needed — Happy/Claude Code will find credentials in the correct home dir. # so no sudo needed — Happy/Claude Code will find credentials in the correct home dir.
echo "Starting Happy Coder..." echo "Starting Happy Coder..."
# Remove stale lock file left by a previously crashed daemon — without this, # HAPPY_HOME_DIR is in /workspace (emptyDir), so it is always fresh on pod start.
# happy daemon start refuses to start and exits with "Failed to start daemon". # Remove the lock file as a safety net in case daemon start is called more than
rm -f "${HAPPY_HOME_DIR:-$HOME/.happy}/daemon.state.json.lock" # once within the same container lifetime.
rm -f "${HAPPY_HOME_DIR:-/workspace/.happy}/daemon.state.json.lock"
cd "$WORKSPACE_DIR" cd "$WORKSPACE_DIR"
happy daemon start || echo "Happy Coder daemon failed to start, continuing anyway..." happy daemon start || echo "Happy Coder daemon failed to start, continuing anyway..."