mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-07-08 11:31:44 +08:00
fix(core): 引入 Ceasefire Protocol (停火协议),彻底解决 Systemd 架构下 OTA 升级引发的无限重启风暴
This commit is contained in:
@@ -164,6 +164,11 @@ fi
|
|||||||
|
|
||||||
# ================== [v3.1.1/v3.2.2 优化: 安装前环境纯净度清理] ==================
|
# ================== [v3.1.1/v3.2.2 优化: 安装前环境纯净度清理] ==================
|
||||||
echo -e "\n⏳ 正在清理旧版守护进程与冗余任务..."
|
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 及各类看门狗进程,释放端口
|
# 1. 强制超度可能存活的 Webhook 及各类看门狗进程,释放端口
|
||||||
pkill -9 -f "webhook.py" >/dev/null 2>&1 || true
|
pkill -9 -f "webhook.py" >/dev/null 2>&1 || true
|
||||||
pkill -9 -f "agent_daemon.sh" >/dev/null 2>&1 || true
|
pkill -9 -f "agent_daemon.sh" >/dev/null 2>&1 || true
|
||||||
|
|||||||
@@ -105,6 +105,10 @@ fi
|
|||||||
|
|
||||||
# ================== [v3.2.2 优化: 安装前环境纯净度清理与数据保护] ==================
|
# ================== [v3.2.2 优化: 安装前环境纯净度清理与数据保护] ==================
|
||||||
echo -e "\n⏳ 正在清理旧版 Master 守护进程..."
|
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
|
pkill -9 -f "tg_master.sh" >/dev/null 2>&1 || true
|
||||||
|
|
||||||
if [ "$UPGRADE_MODE" == "true" ]; then
|
if [ "$UPGRADE_MODE" == "true" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user