mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
修改进程默认退出信号
This commit is contained in:
parent
acecf01cbe
commit
10fab9d415
|
@ -468,10 +468,11 @@ export function psTree(pid: number): Promise<number[]> {
|
||||||
|
|
||||||
export async function killTask(pid: number) {
|
export async function killTask(pid: number) {
|
||||||
const pids = await psTree(pid);
|
const pids = await psTree(pid);
|
||||||
|
// SIGALRM 14 时钟信号
|
||||||
if (pids.length) {
|
if (pids.length) {
|
||||||
process.kill(pids[0], 2);
|
process.kill(pids[0], 14);
|
||||||
} else {
|
} else {
|
||||||
process.kill(pid, 2);
|
process.kill(pid, 14);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ dir_shell=$QL_DIR/shell
|
||||||
. $dir_shell/share.sh
|
. $dir_shell/share.sh
|
||||||
. $dir_shell/api.sh
|
. $dir_shell/api.sh
|
||||||
|
|
||||||
trap "single_hanle" 2 20 15
|
trap "single_hanle" 2 20 15 14
|
||||||
single_hanle() {
|
single_hanle() {
|
||||||
handle_task_after "$@"
|
handle_task_after "$@"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -56,7 +56,7 @@ format_params() {
|
||||||
time_format="%Y-%m-%d %H:%M:%S"
|
time_format="%Y-%m-%d %H:%M:%S"
|
||||||
timeoutCmd=""
|
timeoutCmd=""
|
||||||
if type timeout &>/dev/null; then
|
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
|
fi
|
||||||
params=$(echo "$@" | sed -E 's/([^ ])&([^ ])/\1\\\&\2/g')
|
params=$(echo "$@" | sed -E 's/([^ ])&([^ ])/\1\\\&\2/g')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user