Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KYUUBI #5987] Enhance KYUUBI_HOME detection in shell script to handle softlink cases #5988

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/beeline
Original file line number Diff line number Diff line change
Expand Up @@ -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
export KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export is not required

fi

. "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s

Expand Down
2 changes: 1 addition & 1 deletion bin/docker-image-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function error {
}

if [ -z "${KYUUBI_HOME}" ]; then
KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)"
export KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)"
fi
KYUUBI_IMAGE_NAME="kyuubi"

Expand Down
4 changes: 3 additions & 1 deletion bin/kyuubi
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ function kyuubi_rotate_log() {
fi
}

export KYUUBI_HOME="$(cd "$(dirname "$0")"/..; pwd)"
if [ -z "${KYUUBI_HOME}" ]; then
export KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)"
fi

if [[ $1 == "start" ]] || [[ $1 == "run" ]]; then
. "${KYUUBI_HOME}/bin/load-kyuubi-env.sh"
Expand Down
4 changes: 3 additions & 1 deletion bin/kyuubi-admin
Original file line number Diff line number Diff line change
Expand Up @@ -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
export KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)"
fi

. "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s

Expand Down
4 changes: 3 additions & 1 deletion bin/kyuubi-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -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
export KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)"
fi

. "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s

Expand Down
5 changes: 3 additions & 2 deletions bin/kyuubi-zk-cli
Original file line number Diff line number Diff line change
Expand Up @@ -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
export KYUUBI_HOME="$(cd "`dirname "$0"`"/..; pwd)"
fi
. "${KYUUBI_HOME}/bin/load-kyuubi-env.sh" -s

if [[ -z ${JAVA_HOME} ]]; then
Expand Down
5 changes: 3 additions & 2 deletions bin/load-kyuubi-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"`"/..; pwd)"
fi
export KYUUBI_CONF_DIR="${KYUUBI_CONF_DIR:-"${KYUUBI_HOME}"/conf}"

silent=0
Expand Down
Loading