From db145e0c9add81c74d853baa8187005f97ea1b53 Mon Sep 17 00:00:00 2001 From: Karthik Kambatla Date: Thu, 1 Oct 2015 11:29:50 -0700 Subject: [PATCH] HADOOP-12451. Setting HADOOP_HOME explicitly should be allowed. (kasha) --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ .../hadoop-common/src/main/bin/hadoop-config.sh | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index bdc994698ac..04a84f1ebbb 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -707,6 +707,8 @@ Release 2.7.2 - UNRELEASED HADOOP-12213. Interrupted exception can occur when Client#stop is called. (Kuhu Shukla via ozawa) + + HADOOP-12451. Setting HADOOP_HOME explicitly should be allowed. (kasha) Release 2.7.1 - 2015-07-06 diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh index 4c440711896..ab9e6429099 100644 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh @@ -250,7 +250,10 @@ TOOL_PATH="${TOOL_PATH:-$HADOOP_PREFIX/share/hadoop/tools/lib/*}" HADOOP_OPTS="$HADOOP_OPTS -Dhadoop.log.dir=$HADOOP_LOG_DIR" HADOOP_OPTS="$HADOOP_OPTS -Dhadoop.log.file=$HADOOP_LOGFILE" -HADOOP_HOME=$HADOOP_PREFIX + +if [ "$HADOOP_HOME" = "" ]; then + HADOOP_HOME=$HADOOP_PREFIX +fi if [ "$cygwin" = true ]; then HADOOP_HOME=$(cygpath -w "$HADOOP_HOME" 2>/dev/null) fi