Fix Admin UI status detection to catch port binding errors
- Increase sleep time to 2 seconds to allow error detection - Check log file for 'Address already in use' error - Show helpful message to run --kill-ports when port is in use - Kill the failed process to prevent zombie processes
This commit is contained in:
@@ -146,10 +146,19 @@ if ! command -v trunk &> /dev/null; then
|
|||||||
else
|
else
|
||||||
trunk serve --port "$ADMIN_UI_PORT" > /tmp/supervisor-ui.log 2>&1 &
|
trunk serve --port "$ADMIN_UI_PORT" > /tmp/supervisor-ui.log 2>&1 &
|
||||||
ADMIN_UI_PID=$!
|
ADMIN_UI_PID=$!
|
||||||
sleep 1
|
sleep 2
|
||||||
|
|
||||||
|
# Check if process is still running
|
||||||
if ps -p $ADMIN_UI_PID > /dev/null 2>&1; then
|
if ps -p $ADMIN_UI_PID > /dev/null 2>&1; then
|
||||||
echo "✅"
|
# Check for port binding errors in log
|
||||||
UI_STARTED=true
|
if grep -q "Address already in use" /tmp/supervisor-ui.log 2>/dev/null; then
|
||||||
|
echo "❌"
|
||||||
|
UI_ERROR="Port $ADMIN_UI_PORT already in use. Run: ./scripts/run.sh --kill-ports"
|
||||||
|
kill $ADMIN_UI_PID 2>/dev/null
|
||||||
|
else
|
||||||
|
echo "✅"
|
||||||
|
UI_STARTED=true
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "❌"
|
echo "❌"
|
||||||
UI_ERROR="Failed to start"
|
UI_ERROR="Failed to start"
|
||||||
|
|||||||
Reference in New Issue
Block a user