Skip to content

Commit

Permalink
Start non-thrift services skips checking for gracefully stopping proc…
Browse files Browse the repository at this point in the history
…esses
  • Loading branch information
wangjunbo authored and wForget committed Mar 14, 2024
1 parent 80e8964 commit f70e954
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions bin/kyuubi
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -221,6 +224,11 @@ case $1 in
start_kyuubi
;;

(startNew)
start_kyuubi $1
;;


(restart)
echo "Restarting Kyuubi"
stop_kyuubi
Expand Down

0 comments on commit f70e954

Please sign in to comment.