fix(core): 引入 Ceasefire Protocol (停火协议),彻底解决 Systemd 架构下 OTA 升级引发的无限重启风暴

This commit is contained in:
hotyue
2026-04-21 02:21:43 +00:00
parent 34320b2385
commit 0bb96169e5
2 changed files with 9 additions and 0 deletions

View File

@@ -164,6 +164,11 @@ fi
# ================== [v3.1.1/v3.2.2 优化: 安装前环境纯净度清理] ==================
echo -e "\n⏳ 正在清理旧版守护进程与冗余任务..."
# [新增] 优雅停止 Systemd 服务,防止代码替换时引发无限复活风暴
if command -v systemctl >/dev/null 2>&1; then
systemctl stop ip-sentinel-runner.timer ip-sentinel-updater.timer ip-sentinel-report.timer ip-sentinel-agent-daemon.service >/dev/null 2>&1 || true
fi
# 1. 强制超度可能存活的 Webhook 及各类看门狗进程,释放端口
pkill -9 -f "webhook.py" >/dev/null 2>&1 || true
pkill -9 -f "agent_daemon.sh" >/dev/null 2>&1 || true

View File

@@ -105,6 +105,10 @@ fi
# ================== [v3.2.2 优化: 安装前环境纯净度清理与数据保护] ==================
echo -e "\n⏳ 正在清理旧版 Master 守护进程..."
# [新增] 优雅停止 Systemd 服务,防止代码替换时引发无限复活风暴
if command -v systemctl >/dev/null 2>&1; then
systemctl stop ip-sentinel-master.service >/dev/null 2>&1 || true
fi
pkill -9 -f "tg_master.sh" >/dev/null 2>&1 || true
if [ "$UPGRADE_MODE" == "true" ]; then