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

@@ -8,12 +8,17 @@ cd "$DJANGO_DIR"
echo ">>> git pull"
git pull origin main
echo ">>> 更新 gunicorn systemd"
echo ">>> 更新 gunicorn systemd(先停再起,避免 8001 双开)"
cp deploy/systemd/gunicorn-dianjing.service /etc/systemd/system/gunicorn-dianjing.service
systemctl daemon-reload
systemctl enable gunicorn-dianjing.service
systemctl restart gunicorn-dianjing.service
systemctl stop gunicorn-dianjing.service 2>/dev/null || true
sleep 2
pkill -f 'gunicorn.*a_long_dianjing' 2>/dev/null || true
pkill -f 'gunicorn -c gunicorn.conf.py' 2>/dev/null || true
sleep 2
systemctl start gunicorn-dianjing.service
sleep 3
echo ">>> 状态"
systemctl is-active gunicorn-dianjing.service