diff --git a/bin/kyuubi b/bin/kyuubi index 7dd5bb4eeeb..da4f96a3e5a 100755 --- a/bin/kyuubi +++ b/bin/kyuubi @@ -26,6 +26,7 @@ function usage() { echo " restart - Restart Kyuubi server as a daemon" echo " run - Run a Kyuubi server in the foreground" echo " stop - Stop the Kyuubi daemon" + echo " kill - Stop the Kyuubi daemon forcefully" echo " status - Show status of the Kyuubi daemon" echo " -h | --help - Show this help message" } @@ -107,7 +108,7 @@ if [[ -n ${YARN_CONF_DIR} ]]; then KYUUBI_CLASSPATH="${KYUUBI_CLASSPATH}:${YARN_CONF_DIR}" fi -if [[ "$1" =~ ^(start|restart|run|stop|status)$ ]]; then +if [[ "$1" =~ ^(start|restart|run|stop|kill|status)$ ]]; then command=$1 shift fi @@ -215,6 +216,18 @@ function stop_kyuubi() { fi } +function kill_kyuubi() { + if [ -f ${pid} ]; then + TARGET_ID="$(cat "$pid")" + echo "Stopping $CLASS forcefully." + kill -9 $TARGET_ID + kyuubi_logo + echo "Bye!" + else + echo "no $CLASS to stop" + fi +} + function check_kyuubi() { if [[ -f ${pid} ]]; then TARGET_ID="$(cat "$pid")" @@ -247,6 +260,10 @@ case $command in stop_kyuubi ;; + (kill) + kill_kyuubi + ;; + (status) check_kyuubi ;;