mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-05-19 19:49:31 +08:00
fix(core): 移除 agent_daemon.sh 尾部的 nohup 后台逻辑,适配 Systemd Type=simple 的前台阻塞监听,修复 cgroup 误杀导致的无限重启死循环
This commit is contained in:
@@ -407,8 +407,8 @@ except Exception as e:
|
||||
# ====================================================================================
|
||||
EOF
|
||||
|
||||
# --- [重点升级 3: 真正的静默后台启动] ---
|
||||
echo "🚀 [Agent] 正在后台启动 Webhook 监听服务 (端口: $AGENT_PORT)..."
|
||||
nohup python3 "${INSTALL_DIR}/core/webhook.py" "$AGENT_PORT" > /dev/null 2>&1 &
|
||||
disown 2>/dev/null || true
|
||||
echo "✅ [Agent] 守护进程启动完毕,可安全关闭终端。"
|
||||
# --- [重点升级 3: 移交系统级守护进程接管] ---
|
||||
echo "🚀 [Agent] 正在启动 Webhook 监听服务 (端口: $AGENT_PORT)..."
|
||||
# 去掉 nohup 和 &,使用 exec 让 Python 进程直接替换当前 Bash 进程,前台阻塞运行
|
||||
# 这样 Systemd 才能真正捕捉到 Python 进程的生命周期,永不误杀!
|
||||
exec python3 "${INSTALL_DIR}/core/webhook.py" "$AGENT_PORT"
|
||||
Reference in New Issue
Block a user