fix: 8001 端口冲突修复脚本,防止双开 gunicorn 卡死全站
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user