From 82e2da631feaa61c0ceaba65082809e5984cbde4 Mon Sep 17 00:00:00 2001 From: juewuy Date: Tue, 9 Dec 2025 15:14:37 +0800 Subject: [PATCH] =?UTF-8?q?~=E6=94=B9=E4=B8=BA=E4=BD=BF=E7=94=A8=E5=AE=88?= =?UTF-8?q?=E6=8A=A4=E8=BF=9B=E7=A8=8B=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/shellcrash.openrc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/shellcrash.openrc b/scripts/shellcrash.openrc index 36de2bd..acd92ba 100644 --- a/scripts/shellcrash.openrc +++ b/scripts/shellcrash.openrc @@ -1,7 +1,7 @@ #!/sbin/openrc-run # 服务名 -name="ShellCrash" +name="shellcrash" description="Custom proxy service for ShellCrash" #获取目录 CRASHDIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}') @@ -40,13 +40,13 @@ start() { return fi - # 启动主程序(后台进程) - start-stop-daemon --start \ - --background \ - --make-pidfile \ + # 启动主程序(自动守护 + 自动重启) + supervise-daemon "${name}" \ --pidfile "${pidfile}" \ --user "${runuser}" \ - --exec ${COMMAND%% *} -- ${COMMAND#* } + --respawn-max 0 \ + --respawn-delay 3 \ + --start ${COMMAND%% *} -- ${COMMAND#* } ret=$? eend $ret