Skip to content

Commit 901ffc4

Browse files
DavidsonGomesclaude
andcommitted
fix: regenerate start-services.sh with correct paths during install-service
The copied start-services.sh had hardcoded /root/ paths from the original installation. Now regenerated with the service user's paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ec5ad9c commit 901ffc4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

install-service.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,34 @@ fi
6363
chown -R "$SERVICE_USER:$SERVICE_USER" "$SERVICE_DIR"
6464
chown -R "$SERVICE_USER:$SERVICE_USER" "$SERVICE_HOME"
6565

66+
# ── Step 2b: Regenerate start-services.sh with correct paths ──
67+
68+
LOGS_DIR="$SERVICE_DIR/logs"
69+
echo -e " Generating start-services.sh..."
70+
cat > "$SERVICE_DIR/start-services.sh" << STARTEOF
71+
#!/bin/bash
72+
export PATH="/usr/local/bin:/usr/bin:/bin:\$HOME/.local/bin"
73+
cd $SERVICE_DIR
74+
75+
# Kill existing services
76+
pkill -f 'terminal-server/bin/server.js' 2>/dev/null
77+
pkill -f 'dashboard/backend.*app.py' 2>/dev/null
78+
sleep 1
79+
80+
# Clean stale sessions — old sessions cause agent persona issues
81+
rm -f \$HOME/.claude-code-web/sessions.json 2>/dev/null
82+
83+
# Start terminal-server (must run FROM the project root for agent discovery)
84+
nohup node dashboard/terminal-server/bin/server.js > $LOGS_DIR/terminal-server.log 2>&1 &
85+
86+
# Start Flask dashboard
87+
cd dashboard/backend
88+
nohup $SERVICE_DIR/.venv/bin/python app.py > $LOGS_DIR/dashboard.log 2>&1 &
89+
STARTEOF
90+
chmod 755 "$SERVICE_DIR/start-services.sh"
91+
chown "$SERVICE_USER:$SERVICE_USER" "$SERVICE_DIR/start-services.sh"
92+
echo -e " ${GREEN}${RESET} start-services.sh regenerated"
93+
6694
# ── Step 3: Install uv for the user ──
6795

6896
if su - "$SERVICE_USER" -c "command -v uv" &>/dev/null; then

0 commit comments

Comments
 (0)