Fix: Remove invalid --start flag and add supervisord readiness check

This commit is contained in:
OpenClaw Agent
2026-02-24 16:41:47 +08:00
parent a882e5901e
commit 1f1ca56d1a

View File

@@ -109,9 +109,9 @@ else
cd "$APP_DIR"
fi
# Start PostgreSQL
echo "▶ Starting PostgreSQL..."
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf --start postgresql &
# Start supervisord (manages PostgreSQL and Next.js)
echo "▶ Starting services..."
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &
SUPERVISOR_PID=$!
# Wait for PostgreSQL
@@ -150,6 +150,24 @@ if [ ! -f "$SEED_MARKER" ]; then
fi
fi
# Wait for supervisord socket to be ready
echo "▶ Waiting for supervisord..."
for i in $(seq 1 30); do
if supervisorctl -c /etc/supervisor/conf.d/supervisord.conf status >/dev/null 2>&1; then
echo "✓ Supervisord is ready"
break
fi
if [ $i -eq 30 ]; then
echo "✗ Supervisord failed to start"
exit 1
fi
sleep 1
done
# Start Next.js
echo "▶ Starting Next.js..."
supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start nextjs
echo ""
echo "╔═══════════════════════════════════════════════════════════════╗"
echo "║ ║"