mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-11 09:55:59 +00:00
Harden dev service daemon startup
This commit is contained in:
+7
-4
@@ -495,11 +495,14 @@ run_service() {
|
||||
|
||||
echo "Starting $name..."
|
||||
if $DAEMON_MODE; then
|
||||
nohup sh -c "$cmd" > /dev/null 2>&1 &
|
||||
nohup sh -c "$cmd" < /dev/null > /dev/null 2>&1 &
|
||||
else
|
||||
sh -c "$cmd" &
|
||||
fi
|
||||
service_pid=$!
|
||||
if $DAEMON_MODE; then
|
||||
disown "$service_pid" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
./scripts/wait-for-port.sh "$port" "$timeout" "$name" || {
|
||||
local logfile="logs/$(echo "$name" | tr '[:upper:]' '[:lower:]' | tr ' ' '-').log"
|
||||
@@ -523,17 +526,17 @@ mkdir -p temp/client_body_temp temp/proxy_temp temp/fastcgi_temp temp/uwsgi_temp
|
||||
|
||||
# 1. Gateway API
|
||||
run_service "Gateway" \
|
||||
"cd backend && PYTHONPATH=. uv run uvicorn app.gateway.app:app --host 0.0.0.0 --port 8001 $GATEWAY_EXTRA_FLAGS > ../logs/gateway.log 2>&1" \
|
||||
"cd backend && exec env PYTHONPATH=. uv run uvicorn app.gateway.app:app --host 0.0.0.0 --port 8001 $GATEWAY_EXTRA_FLAGS > ../logs/gateway.log 2>&1" \
|
||||
8001 30
|
||||
|
||||
# 2. Frontend
|
||||
run_service "Frontend" \
|
||||
"cd frontend && $FRONTEND_CMD > ../logs/frontend.log 2>&1" \
|
||||
"cd frontend && exec $FRONTEND_CMD > ../logs/frontend.log 2>&1" \
|
||||
3000 120
|
||||
|
||||
# 3. Nginx
|
||||
run_service "Nginx" \
|
||||
"nginx -g 'daemon off;' -c '$REPO_ROOT/docker/nginx/nginx.local.conf' -p '$REPO_ROOT' > logs/nginx.log 2>&1" \
|
||||
"exec nginx -g 'daemon off;' -c '$REPO_ROOT/docker/nginx/nginx.local.conf' -p '$REPO_ROOT' > logs/nginx.log 2>&1" \
|
||||
2026 10
|
||||
|
||||
# ── Ready ────────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user