You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/12/30 01:40:36 UTC

[GitHub] [incubator-kyuubi] wForget commented on a change in pull request #1650: [KYUUBI #1649] Determine the yarn command in stop-application.sh.

wForget commented on a change in pull request #1650:
URL: https://github.com/apache/incubator-kyuubi/pull/1650#discussion_r776542217



##########
File path: bin/stop-application.sh
##########
@@ -21,9 +21,23 @@ if [[ $# < 1 ]] ; then
   exit 1
 fi
 
-if [[ -z ${HADOOP_HOME} ]]; then
-  echo "Error: HADOOP_HOME IS NOT SET! CANNOT PROCEED."
+check_cmd() {
+    command -v "$1" > /dev/null 2>&1
+}
+
+YARN_CMD=""
+
+if check_cmd "yarn"; then
+  YARN_CMD="yarn"
+fi
+
+if [ -z "$YARN_CMD" ] && [ -n "${HADOOP_HOME}" ] && check_cmd "${HADOOP_HOME}/bin/yarn"; then
+  YARN_CMD="${HADOOP_HOME}/bin/yarn"
+fi
+
+if [[ -z "$YARN_CMD" ]]; then
+  echo "Error: Cannot find yarn command! CANNOT PROCEED."

Review comment:
       Great, i will do that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org