fix: 8001 端口冲突修复脚本,防止双开 gunicorn 卡死全站

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-09 05:10:39 +08:00
parent a48c9d3134
commit ad63b3f1ee
3 changed files with 71 additions and 2 deletions

View File

@@ -27,6 +27,12 @@ NG=$(pgrep -cf 'gunicorn.*a_long_dianjing' 2>/dev/null || echo 0)
if [ "$NG" -gt 8 ]; then
echo ">>> 警告: gunicorn 进程过多($NG),可能 systemd + 1Panel 双开,必须只留 systemd"
fi
RECENT=$(grep -a 'Connection in use' /tmp/gunicorn-error.log 2>/dev/null | tail -1)
if [ -n "$RECENT" ]; then
echo ">>> 警告: error.log 曾出现 8001 端口冲突(双开 gunicorn:"
echo " $RECENT"
echo " 执行: bash deploy/fix-gunicorn-8001-conflict.sh"
fi
if grep -q 'worker_class.*sync' "$CONF" 2>/dev/null; then
echo ">>> 致命: gunicorn.conf.py 仍是 sync全站会卡死必须改为 gthread 并 restart"
fi