From 82530ba0f1fddffe1930eceb410596ca82d918d2 Mon Sep 17 00:00:00 2001 From: cnauroth Date: Wed, 13 May 2015 12:25:49 -0700 Subject: [PATCH] HADOOP-11966. Variable cygwin is undefined in hadoop-config.sh when executed through hadoop-daemon.sh. Contributed by Chris Nauroth. (cherry picked from commit ddc4afeff256e124ce4291c7a2bab37ad55c8e5c) --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ hadoop-common-project/hadoop-common/src/main/bin/hadoop | 5 ----- .../hadoop-common/src/main/bin/hadoop-config.sh | 5 +++++ hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs | 5 ----- hadoop-mapreduce-project/bin/mapred | 5 ----- hadoop-yarn-project/hadoop-yarn/bin/yarn | 5 ----- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 002c9778c5f..f63a69a0a79 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -32,6 +32,9 @@ Release 2.7.1 - UNRELEASED HADOOP-11663. Remove description about Java 6 from docs. (Masatake Iwasaki via aajisaka) + HADOOP-11966. Variable cygwin is undefined in hadoop-config.sh when executed + through hadoop-daemon.sh. (cnauroth) + Release 2.7.0 - 2015-04-20 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop b/hadoop-common-project/hadoop-common/src/main/bin/hadoop index bec15cf6b81..a5e88857b40 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop @@ -23,11 +23,6 @@ bin=`cd "$bin"; pwd` DEFAULT_LIBEXEC_DIR="$bin"/../libexec -cygwin=false -case "$(uname)" in -CYGWIN*) cygwin=true;; -esac - HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} . $HADOOP_LIBEXEC_DIR/hadoop-config.sh 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 c2b5df42f59..3c3c19f3cd3 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 @@ -145,6 +145,11 @@ if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then . "${HADOOP_CONF_DIR}/hadoop-env.sh" fi +cygwin=false +case "$(uname)" in +CYGWIN*) cygwin=true;; +esac + # check if net.ipv6.bindv6only is set to 1 bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null) if [ -n "$bindv6only" ] && [ "$bindv6only" -eq "1" ] && [ "$HADOOP_ALLOW_IPV6" != "yes" ] diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs index dabef1867fb..155df141842 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs @@ -31,11 +31,6 @@ bin=`cd "$bin" > /dev/null; pwd` DEFAULT_LIBEXEC_DIR="$bin"/../libexec -cygwin=false -case "$(uname)" in -CYGWIN*) cygwin=true;; -esac - HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} . $HADOOP_LIBEXEC_DIR/hdfs-config.sh diff --git a/hadoop-mapreduce-project/bin/mapred b/hadoop-mapreduce-project/bin/mapred index a70faf0a3cb..fe16e077a72 100755 --- a/hadoop-mapreduce-project/bin/mapred +++ b/hadoop-mapreduce-project/bin/mapred @@ -21,11 +21,6 @@ bin=`cd "$bin"; pwd` DEFAULT_LIBEXEC_DIR="$bin"/../libexec -cygwin=false -case "$(uname)" in -CYGWIN*) cygwin=true;; -esac - HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} if [ -e ${HADOOP_LIBEXEC_DIR}/mapred-config.sh ]; then . ${HADOOP_LIBEXEC_DIR}/mapred-config.sh diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn index 872394c4a87..7e3c29fe93c 100644 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn @@ -56,11 +56,6 @@ bin=`cd "$bin"; pwd` DEFAULT_LIBEXEC_DIR="$bin"/../libexec -cygwin=false -case "$(uname)" in -CYGWIN*) cygwin=true;; -esac - HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} . $HADOOP_LIBEXEC_DIR/yarn-config.sh