From 06656b5694d20f340b99a891b3e63e74e0a28395 Mon Sep 17 00:00:00 2001 From: juewuy Date: Wed, 14 Jan 2026 19:52:19 +0800 Subject: [PATCH] =?UTF-8?q?~=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=E5=8D=8E?= =?UTF-8?q?=E7=A1=95=E8=AE=BE=E5=A4=87=E5=85=B3=E9=97=ADssh=E6=97=B6?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E6=B3=A8=E9=94=80=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/starts/start_legacy.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/starts/start_legacy.sh b/scripts/starts/start_legacy.sh index f05df7f9..bcbd4dc1 100644 --- a/scripts/starts/start_legacy.sh +++ b/scripts/starts/start_legacy.sh @@ -2,16 +2,14 @@ . "$CRASHDIR"/libs/check_cmd.sh start_legacy(){ + ckcmd nohup && _nohup=nohup if ckcmd su && grep -q 'shellcrash:x:0:7890' /etc/passwd;then - su shellcrash -c "$1 >/dev/null 2>&1 & echo \$! > /tmp/ShellCrash/$2.pid" + su shellcrash -c "$_nohup $1 >/dev/null 2>&1 & echo \$! > /tmp/ShellCrash/$2.pid" elif ckcmd setsid; then - setsid $1 >/dev/null 2>&1 & + $_nohup setsid $1 >/dev/null 2>&1 & echo $! > "/tmp/ShellCrash/$2.pid" - elif ckcmd nohup; then - nohup $1 >/dev/null 2>&1 & - echo $! > "/tmp/ShellCrash/$2.pid" else - $1 >/dev/null 2>&1 & + $_nohup $1 >/dev/null 2>&1 & echo $! > "/tmp/ShellCrash/$2.pid" fi }