From 10fab9d415788e796a3c5bc3820547cce4ed5a5f Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 5 Dec 2022 21:00:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E7=A8=8B=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=80=E5=87=BA=E4=BF=A1=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/config/util.ts | 5 +++-- shell/otask.sh | 2 +- shell/task.sh | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/back/config/util.ts b/back/config/util.ts index f057d7ed..2282a6ac 100644 --- a/back/config/util.ts +++ b/back/config/util.ts @@ -468,10 +468,11 @@ export function psTree(pid: number): Promise { export async function killTask(pid: number) { const pids = await psTree(pid); + // SIGALRM 14 时钟信号 if (pids.length) { - process.kill(pids[0], 2); + process.kill(pids[0], 14); } else { - process.kill(pid, 2); + process.kill(pid, 14); } } diff --git a/shell/otask.sh b/shell/otask.sh index 93512936..44a08ee1 100644 --- a/shell/otask.sh +++ b/shell/otask.sh @@ -5,7 +5,7 @@ dir_shell=$QL_DIR/shell . $dir_shell/share.sh . $dir_shell/api.sh -trap "single_hanle" 2 20 15 +trap "single_hanle" 2 20 15 14 single_hanle() { handle_task_after "$@" exit 1 diff --git a/shell/task.sh b/shell/task.sh index 1051416c..aa853843 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -56,7 +56,7 @@ format_params() { time_format="%Y-%m-%d %H:%M:%S" timeoutCmd="" if type timeout &>/dev/null; then - timeoutCmd="timeout --foreground -s 2 -k 10s $command_timeout_time " + timeoutCmd="timeout --foreground -s 14 -k 10s $command_timeout_time " fi params=$(echo "$@" | sed -E 's/([^ ])&([^ ])/\1\\\&\2/g') }