mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-11 07:51:45 +00:00
~尝试修复华硕设备关闭ssh时进程注销的bug
This commit is contained in:
@@ -2,16 +2,14 @@
|
|||||||
. "$CRASHDIR"/libs/check_cmd.sh
|
. "$CRASHDIR"/libs/check_cmd.sh
|
||||||
|
|
||||||
start_legacy(){
|
start_legacy(){
|
||||||
|
ckcmd nohup && _nohup=nohup
|
||||||
if ckcmd su && grep -q 'shellcrash:x:0:7890' /etc/passwd;then
|
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
|
elif ckcmd setsid; then
|
||||||
setsid $1 >/dev/null 2>&1 &
|
$_nohup setsid $1 >/dev/null 2>&1 &
|
||||||
echo $! > "/tmp/ShellCrash/$2.pid"
|
echo $! > "/tmp/ShellCrash/$2.pid"
|
||||||
elif ckcmd nohup; then
|
|
||||||
nohup $1 >/dev/null 2>&1 &
|
|
||||||
echo $! > "/tmp/ShellCrash/$2.pid"
|
|
||||||
else
|
else
|
||||||
$1 >/dev/null 2>&1 &
|
$_nohup $1 >/dev/null 2>&1 &
|
||||||
echo $! > "/tmp/ShellCrash/$2.pid"
|
echo $! > "/tmp/ShellCrash/$2.pid"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user