From 7bcfb5af482110b3557951f57b89cbeb2790174c Mon Sep 17 00:00:00 2001 From: Gavin Chou Date: Sat, 31 Aug 2024 21:24:40 +0800 Subject: [PATCH] [chore](cloud) Improve cloud start stop script: wait for quit synchronously --- cloud/script/start.sh | 4 ++-- cloud/script/stop.sh | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cloud/script/start.sh b/cloud/script/start.sh index 2e444ac1778e6d..28e986166ae832 100644 --- a/cloud/script/start.sh +++ b/cloud/script/start.sh @@ -82,7 +82,7 @@ if ldd "${bin}" | grep -Ei 'libfdb_c.*not found' &>/dev/null; then exit 1 fi patchelf --set-rpath "${lib_path}" "${bin}" - ldd "${bin}" + # ldd "${bin}" fi chmod 550 "${DORIS_HOME}/lib/doris_cloud" @@ -91,7 +91,7 @@ if [[ -z "${JAVA_HOME}" ]]; then echo "The JAVA_HOME environment variable is not defined correctly" echo "This environment variable is needed to run this program" echo "NB: JAVA_HOME should point to a JDK not a JRE" - echo "You can set it in be.conf" + echo "You can set it in doris_cloud.conf" exit 1 fi diff --git a/cloud/script/stop.sh b/cloud/script/stop.sh index b40b4061c398dc..48f01c545ae840 100644 --- a/cloud/script/stop.sh +++ b/cloud/script/stop.sh @@ -32,4 +32,17 @@ fi pid=$(cat "${DORIS_HOME}/bin/${process}.pid") kill -2 "${pid}" +cnt=0 +while true; do + cnt=$((cnt + 1)) + echo "waiting ${pid} to quit, ${cnt} seconds elapsed" + msg=$(ps "${pid}") + ret=$? + if [[ ${ret} -ne 0 ]]; then + echo "${pid} has quit" + break + fi + echo "${msg}" + sleep 1 +done rm -f "${DORIS_HOME}/bin/${process}.pid"