File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 6363chown -R " $SERVICE_USER :$SERVICE_USER " " $SERVICE_DIR "
6464chown -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
6896if su - " $SERVICE_USER " -c " command -v uv" & > /dev/null; then
You can’t perform that action at this time.
0 commit comments