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') }