diff --git a/bin/beeline b/bin/beeline index 3581f6dd6bd..f277efa440f 100755 --- a/bin/beeline +++ b/bin/beeline @@ -19,7 +19,9 @@ ## Kyuubi BeeLine Entrance CLASS="org.apache.hive.beeline.KyuubiBeeLine" -export KYUUBI_HOME="$(cd "$(dirname "$0")"/..; pwd)" +if [ -z "${KYUUBI_HOME}" ]; then + KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi . "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s diff --git a/bin/kyuubi b/bin/kyuubi index 9132aae39e8..17ab717e5ee 100755 --- a/bin/kyuubi +++ b/bin/kyuubi @@ -62,7 +62,9 @@ function kyuubi_rotate_log() { fi } -export KYUUBI_HOME="$(cd "$(dirname "$0")"/..; pwd)" +if [ -z "${KYUUBI_HOME}" ]; then + KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi if [[ $1 == "start" ]] || [[ $1 == "run" ]]; then . "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" diff --git a/bin/kyuubi-admin b/bin/kyuubi-admin index a1f176ec157..8a148d159f7 100755 --- a/bin/kyuubi-admin +++ b/bin/kyuubi-admin @@ -19,7 +19,9 @@ ## Kyuubi Admin Control Client Entrance CLASS="org.apache.kyuubi.ctl.cli.AdminControlCli" -export KYUUBI_HOME="$(cd "$(dirname "$0")"/..; pwd)" +if [ -z "${KYUUBI_HOME}" ]; then + KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi . "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s diff --git a/bin/kyuubi-ctl b/bin/kyuubi-ctl index 16809c0754b..0214737d46a 100755 --- a/bin/kyuubi-ctl +++ b/bin/kyuubi-ctl @@ -19,7 +19,9 @@ ## Kyuubi Control Client Entrance CLASS="org.apache.kyuubi.ctl.cli.ControlCli" -export KYUUBI_HOME="$(cd "$(dirname "$0")"/..; pwd)" +if [ -z "${KYUUBI_HOME}" ]; then + KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi . "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s diff --git a/bin/kyuubi-zk-cli b/bin/kyuubi-zk-cli index f503c3e5a5e..c85f47c4c5d 100755 --- a/bin/kyuubi-zk-cli +++ b/bin/kyuubi-zk-cli @@ -19,8 +19,9 @@ ## Zookeeper Shell Client Entrance CLASS="org.apache.kyuubi.shaded.zookeeper.ZooKeeperMain" -export KYUUBI_HOME="$(cd "$(dirname "$0")"/..; pwd)" - +if [ -z "${KYUUBI_HOME}" ]; then + KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi . "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s if [[ -z ${JAVA_HOME} ]]; then diff --git a/bin/load-kyuubi-env.sh b/bin/load-kyuubi-env.sh index 4d6f72ddf3e..fdff1e0c571 100755 --- a/bin/load-kyuubi-env.sh +++ b/bin/load-kyuubi-env.sh @@ -17,8 +17,9 @@ # -export KYUUBI_HOME="${KYUUBI_HOME:-"$(cd "$(dirname "$0")"/.. || exit; pwd)"}" - +if [ -z "${KYUUBI_HOME}" ]; then + export KYUUBI_HOME="$(cd "$(dirname "$0")"/.. || exit; pwd)" +fi export KYUUBI_CONF_DIR="${KYUUBI_CONF_DIR:-"${KYUUBI_HOME}"/conf}" silent=0