From 27a5097756f17c2dddde70acc60b9e9d1c8c79f8 Mon Sep 17 00:00:00 2001 From: Muse Date: Thu, 22 Oct 2026 13:12:57 +0000 Subject: [PATCH] =?UTF-8?q?feat(install-agent):=20=E7=AC=AC23=E6=9D=A1=20O?= =?UTF-8?q?penRC=20=E9=9F=A7=E6=80=A7=E5=AF=B9=E9=BD=90=E2=80=94=E2=80=94s?= =?UTF-8?q?upervise-daemon=20=E5=AE=88=E6=8A=A4=E6=9B=BF=E4=BB=A3=20comman?= =?UTF-8?q?d=5Fbackground?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenRC 支原用 command_background 后台化,进程崩溃不自动拉起,与 systemd 支 Restart=on-failure 语义不对齐。生成的 /etc/init.d/x-ui-agent 改用 supervisor=supervise-daemon + respawn_delay=5(对齐 RestartSec=5)+ respawn_max=0/respawn_period=0(不限次,对齐持续重试);pidfile 与 output/error_log 约定原样保留,command/command_args 不动,幂等重跑时 init 脚本整文件重写、旧式 command_background 布局自动迁移。 第 15/16/17 条对 OpenRC 路径复核:下载基址、无参沿用、失败报错、收尾 self_check 与 rc-service status 存活断言均在公共段/现有分支内已达标, 未作改动(由新增 OpenRC fake-root 套件实证)。 验证:既有 systemd fake-root 套件 58/58 零回归;新增 OpenRC 套件 (run-tests-openrc.sh,O1–O5)51/51。改动点仅此一处(+7/-1)。 --- install-agent.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install-agent.sh b/install-agent.sh index 081d318..334a1a2 100755 --- a/install-agent.sh +++ b/install-agent.sh @@ -262,7 +262,13 @@ name="x-ui-agent" description="3x-ui lightweight node agent" command="/usr/local/x-ui/xui-agent" command_args="agent" -command_background="yes" +# supervise-daemon 守护(第 23 条):进程崩溃后按 respawn 参数自动拉起, +# 对齐 systemd 支的 Restart=on-failure + RestartSec=5;旧版 command_background +# 只负责后台化、崩溃不重启。respawn_max=0 = 不限次(同 systemd 的持续重试)。 +supervisor="supervise-daemon" +respawn_delay=5 +respawn_max=0 +respawn_period=0 pidfile="/run/x-ui-agent.pid" output_log="/var/log/x-ui-agent.log" error_log="/var/log/x-ui-agent.log"