minor, enhance KYLIN_HOME setup

Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/021ccfd0
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/021ccfd0
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/021ccfd0

Branch: refs/heads/master-cdh5.7
Commit: 021ccfd0984bd41e2f2286ebec83efb551899575
Parents: bebbc78
Author: Yang Li <liy...@apache.org>
Authored: Sat Oct 15 15:58:48 2016 +0800
Committer: Yang Li <liy...@apache.org>
Committed: Sat Oct 15 15:59:38 2016 +0800

----------------------------------------------------------------------
 build/bin/kylin.sh     | 7 ++++---
 build/bin/metastore.sh | 9 +++++----
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/021ccfd0/build/bin/kylin.sh
----------------------------------------------------------------------
diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh
index da53d3d..9286055e 100644
--- a/build/bin/kylin.sh
+++ b/build/bin/kylin.sh
@@ -17,9 +17,10 @@
 # limitations under the License.
 #
 
-# We should set KYLIN_HOME here for multiple tomcat instances that are on the 
same node.
-# In addition, we should set a KYLIN_HOME for the global use as normal.
-KYLIN_HOME=`dirname $0`/..
+dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
+
+# set KYLIN_HOME with consideration for multiple instances that are on the 
same node
+KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"}
 export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd`
 dir="$KYLIN_HOME/bin"
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/021ccfd0/build/bin/metastore.sh
----------------------------------------------------------------------
diff --git a/build/bin/metastore.sh b/build/bin/metastore.sh
index 5f34bff..baf3d7a 100755
--- a/build/bin/metastore.sh
+++ b/build/bin/metastore.sh
@@ -24,11 +24,12 @@
 # take a look at SandboxMetastoreCLI
 
 
-dir=$(dirname ${0})
+dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
 
-# We should set KYLIN_HOME here for multiple tomcat instsances that are on the 
same node.
-# In addition, we should set a KYLIN_HOME for the global use as normal.
-export KYLIN_HOME=${dir}/../
+# set KYLIN_HOME with consideration for multiple instances that are on the 
same node
+KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"}
+export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd`
+dir="$KYLIN_HOME/bin"
 
 source ${dir}/check-env.sh
 

Reply via email to