From 60ff7cc5862f807560b986c583289fdfb31b3b08 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Thu, 23 Jul 2026 07:36:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(agent):=20pangolin-agent.service=20?= =?UTF-8?q?=E8=A1=A5=20ExecReload,=E4=BD=BF=20systemctl=20reload=20?= =?UTF-8?q?=E8=B5=B0=20SIGHUP=20=E7=83=AD=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Service] 块只有 ExecStart,没有 ExecReload——systemctl reload pangolin-agent 返回「Job type reload is not applicable」,运维只能退回 restart,而 restart 会让 agent 进程内 s.started 复位为 false,首次渲染走冷启动 systemctl restart sing-box, 瞬断全部在线用户。这正是 Task 5 SIGHUP 热重载路径存在的意义所在,却因为 unit 文件 缺一行而完全走不通。 Co-Authored-By: Claude Opus 4.8 --- deploy/single-node/systemd/pangolin-agent.service | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/single-node/systemd/pangolin-agent.service b/deploy/single-node/systemd/pangolin-agent.service index 5ce9add..f24fe38 100644 --- a/deploy/single-node/systemd/pangolin-agent.service +++ b/deploy/single-node/systemd/pangolin-agent.service @@ -12,6 +12,10 @@ StartLimitIntervalSec=0 Type=simple EnvironmentFile=/etc/pangolin-agent/agent.env ExecStart=/usr/local/bin/pangolin-agent +# SIGHUP → agent 重读节点本地配置(acl.json/warp.json)并热重渲染,不冷启动 +# sing-box、不踢在线用户。没有这行,`systemctl reload` 会报「Job type reload is +# not applicable」,运维只能退回 restart(整进程重启,sing-box 冷启动瞬断全员)。 +ExecReload=/bin/kill -HUP $MAINPID # 始终自愈(崩溃/被依赖停后都拉起);RestartSec 做退避。 Restart=always RestartSec=5