From f70e954633167f901569288bee09d1a96e0276a2 Mon Sep 17 00:00:00 2001 From: wangjunbo Date: Fri, 30 Dec 2022 15:06:22 +0800 Subject: [PATCH] Start non-thrift services skips checking for gracefully stopping processes --- bin/kyuubi | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/bin/kyuubi b/bin/kyuubi index 9132aae39e8..4fb53d01348 100755 --- a/bin/kyuubi +++ b/bin/kyuubi @@ -23,6 +23,7 @@ function usage() { echo "Usage: bin/kyuubi command" echo " commands:" echo " start - Run a Kyuubi server as a daemon" + echo " startNew - Run a Kyuubi server as a daemon(skips checking for gracefully stopping processes)" echo " restart - Restart Kyuubi server as a daemon" echo " run - Run a Kyuubi server in the foreground" echo " stop - Stop the Kyuubi daemon" @@ -64,7 +65,7 @@ function kyuubi_rotate_log() { export KYUUBI_HOME="$(cd "$(dirname "$0")"/..; pwd)" -if [[ $1 == "start" ]] || [[ $1 == "run" ]]; then +if [[ $1 == "start" ]] || [[ $1 == "startNew" ]] || [[ $1 == "run" ]]; then . "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" else . "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s @@ -115,11 +116,13 @@ function start_kyuubi() { exit 1 fi - if [ -f "$pid" ]; then - TARGET_ID="$(cat "$pid")" - if [[ $(ps -p "$TARGET_ID" -o comm=) =~ "java" ]]; then - echo "$CLASS running as process $TARGET_ID Stop it first." - exit 1 + if [[ $1 != startNew ]]; then + if [ -f "$pid" ]; then + TARGET_ID="$(cat "$pid")" + if [[ $(ps -p "$TARGET_ID" -o comm=) =~ "java" ]]; then + echo "$CLASS running as process $TARGET_ID Stop it first." + exit 1 + fi fi fi @@ -221,6 +224,11 @@ case $1 in start_kyuubi ;; + (startNew) + start_kyuubi $1 + ;; + + (restart) echo "Restarting Kyuubi" stop_kyuubi