From 88110913073d3c4f67570de54287194c96a08e88 Mon Sep 17 00:00:00 2001 From: Jayant Date: Thu, 14 Nov 2024 11:39:32 +0800 Subject: [PATCH] optmize: adjust run parameters and fix error (#76) --- scripts/base.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/base.sh b/scripts/base.sh index 08a8763..cbeed38 100755 --- a/scripts/base.sh +++ b/scripts/base.sh @@ -82,15 +82,19 @@ function kill_pid_listening_on_port() { for p in $pids; do echo "Sending termination signal to $p..." - kill -s SIGTERM $p # 发送 SIGTERM 信号给程序 + kill -s SIGTERM $p # Send SIGTERM signal to the processes done - # 给程序一定时间处理信号后再强制终止 + # Give the processes a certain amount of time to + # handle the signal before forcibly terminating them. sleep 2 + # Ignore errors because the processes may not exist. + set +e for p in $pids; do echo killing $p... kill $p done sleep 1 + set -e }