[Unit] Description=Pangolin node agent (self-enrolls, manages local sing-box) Documentation=https://github.com/wangjia/pangolin After=network-online.target pangolin-server.service # 软依赖:server 只是「想要先起」,不绑生死。agent 靠 gRPC 自重连,server 重启 # (如部署)绝不能把 agent 一起拖停——之前 Requires= 正是「agent 静默掉线」根因(#8)。 Wants=network-online.target pangolin-server.service # 关闭重启频率上限,配合 Restart=always 保证永不放弃自愈(StartLimit* 属 [Unit])。 StartLimitIntervalSec=0 [Service] Type=simple EnvironmentFile=/etc/pangolin-agent/agent.env ExecStart=/usr/local/bin/pangolin-agent # 始终自愈(崩溃/被依赖停后都拉起);RestartSec 做退避。 Restart=always RestartSec=5 # The agent calls `systemctl restart sing-box` after rendering config; # a polkit rule (49-pangolin-singbox.rules) lets the unprivileged pangolin # user manage *only* sing-box.service. User=pangolin [Install] WantedBy=multi-user.target