From 90158a3ec290bb425582a3b3663dde140484ff50 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 18 Nov 2011 01:01:20 +0000 Subject: [PATCH] Merge -r 1203454:1203455 from trunk to branch-0.23. Fixes: MAPREDUCE-3373 git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1203458 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 4 ++-- hadoop-mapreduce-project/bin/mapred | 6 ++++-- hadoop-mapreduce-project/bin/mapred-config.sh | 6 ++++-- hadoop-mapreduce-project/hadoop-yarn/bin/slaves.sh | 4 +++- hadoop-mapreduce-project/hadoop-yarn/bin/start-all.sh | 5 ++++- hadoop-mapreduce-project/hadoop-yarn/bin/stop-all.sh | 5 ++++- hadoop-mapreduce-project/hadoop-yarn/bin/yarn | 4 +++- hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh | 4 +++- hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemons.sh | 4 +++- .../src/contrib/raid/bin/start-raidnode-remote.sh | 4 +++- .../src/contrib/raid/bin/start-raidnode.sh | 4 +++- .../src/contrib/raid/bin/stop-raidnode-remote.sh | 4 +++- .../src/contrib/raid/bin/stop-raidnode.sh | 4 +++- 13 files changed, 42 insertions(+), 16 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index e188416e41e..3af13454aff 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -44,8 +44,8 @@ Release 0.23.1 - Unreleased MAPREDUCE-3169. Create a new MiniMRCluster equivalent which only provides client APIs cross MR1 and MR2. (Ahmed via tucu) - MAPREDUCE-3169. Create a new MiniMRCluster equivalent which only provides - client APIs cross MR1 and MR2. (Ahmed via tucu) + MAPREDUCE-3373. Hadoop scripts unconditionally source + "$bin"/../libexec/hadoop-config.sh. (Bruno Mahé via tomwhite) OPTIMIZATIONS diff --git a/hadoop-mapreduce-project/bin/mapred b/hadoop-mapreduce-project/bin/mapred index e5e9efb4137..de82a03422f 100755 --- a/hadoop-mapreduce-project/bin/mapred +++ b/hadoop-mapreduce-project/bin/mapred @@ -19,8 +19,10 @@ bin=`which $0` bin=`dirname ${bin}` bin=`cd "$bin"; pwd` -if [ -e $bin/../libexec/mapred-config.sh ]; then - . $bin/../libexec/mapred-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +if [ -e ${HADOOP_LIBEXEC_DIR}/mapred-config.sh ]; then + . ${HADOOP_LIBEXEC_DIR}/mapred-config.sh else . "$bin/mapred-config.sh" fi diff --git a/hadoop-mapreduce-project/bin/mapred-config.sh b/hadoop-mapreduce-project/bin/mapred-config.sh index c79f4fb62f2..d1eb627adb2 100644 --- a/hadoop-mapreduce-project/bin/mapred-config.sh +++ b/hadoop-mapreduce-project/bin/mapred-config.sh @@ -22,8 +22,10 @@ bin=`which "$0"` bin=`dirname "${bin}"` bin=`cd "$bin"; pwd` -if [ -e "$bin/../libexec/hadoop-config.sh" ]; then - . "$bin/../libexec/hadoop-config.sh" +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +if [ -e "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]; then + . "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" elif [ -e "${HADOOP_COMMON_HOME}/libexec/hadoop-config.sh" ]; then . "$HADOOP_COMMON_HOME"/libexec/hadoop-config.sh elif [ -e "${HADOOP_COMMON_HOME}/bin/hadoop-config.sh" ]; then diff --git a/hadoop-mapreduce-project/hadoop-yarn/bin/slaves.sh b/hadoop-mapreduce-project/hadoop-yarn/bin/slaves.sh index e32a4514a32..ee834779015 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/bin/slaves.sh +++ b/hadoop-mapreduce-project/hadoop-yarn/bin/slaves.sh @@ -38,7 +38,9 @@ fi bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/yarn-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/yarn-config.sh # If the slaves file is specified in the command line, # then it takes precedence over the definition in diff --git a/hadoop-mapreduce-project/hadoop-yarn/bin/start-all.sh b/hadoop-mapreduce-project/hadoop-yarn/bin/start-all.sh index e1a798f2d46..fa4fcf3d0d3 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/bin/start-all.sh +++ b/hadoop-mapreduce-project/hadoop-yarn/bin/start-all.sh @@ -23,7 +23,10 @@ echo "starting yarn daemons" bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/yarn-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/yarn-config.sh + # start resourceManager "$bin"/yarn-daemon.sh --config $YARN_CONF_DIR start resourcemanager # start nodeManager diff --git a/hadoop-mapreduce-project/hadoop-yarn/bin/stop-all.sh b/hadoop-mapreduce-project/hadoop-yarn/bin/stop-all.sh index 850af3eb01b..546b67f5c96 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/bin/stop-all.sh +++ b/hadoop-mapreduce-project/hadoop-yarn/bin/stop-all.sh @@ -23,7 +23,10 @@ echo "stopping yarn daemons" bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/yarn-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/yarn-config.sh + # stop resourceManager "$bin"/yarn-daemon.sh --config $YARN_CONF_DIR stop resourcemanager # stop nodeManager diff --git a/hadoop-mapreduce-project/hadoop-yarn/bin/yarn b/hadoop-mapreduce-project/hadoop-yarn/bin/yarn index 059bf10d079..b11c94b37ee 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/bin/yarn +++ b/hadoop-mapreduce-project/hadoop-yarn/bin/yarn @@ -44,7 +44,9 @@ bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/yarn-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/yarn-config.sh cygwin=false case "`uname`" in diff --git a/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh b/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh index c3d17242700..39bb76cbe93 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh +++ b/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh @@ -39,7 +39,9 @@ fi bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/yarn-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/yarn-config.sh # get arguments startStop=$1 diff --git a/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemons.sh b/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemons.sh index 4f89a6850ce..e34e4ca8b1e 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemons.sh +++ b/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemons.sh @@ -30,7 +30,9 @@ fi bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. $bin/yarn-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/yarn-config.sh exec "$bin/slaves.sh" --config $YARN_CONF_DIR cd "$YARN_HOME" \; "$bin/yarn-daemon.sh" --config $YARN_CONF_DIR "$@" diff --git a/hadoop-mapreduce-project/src/contrib/raid/bin/start-raidnode-remote.sh b/hadoop-mapreduce-project/src/contrib/raid/bin/start-raidnode-remote.sh index c0aefd31ce2..3e9405eb72f 100644 --- a/hadoop-mapreduce-project/src/contrib/raid/bin/start-raidnode-remote.sh +++ b/hadoop-mapreduce-project/src/contrib/raid/bin/start-raidnode-remote.sh @@ -24,7 +24,9 @@ params=$# bin=`dirname "$0"` bin=`cd "$bin"; pwd` -. "$bin"/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh # get arguments if [ $# -ge 1 ]; then diff --git a/hadoop-mapreduce-project/src/contrib/raid/bin/start-raidnode.sh b/hadoop-mapreduce-project/src/contrib/raid/bin/start-raidnode.sh index 846aa80c68c..d193bb1aeb6 100644 --- a/hadoop-mapreduce-project/src/contrib/raid/bin/start-raidnode.sh +++ b/hadoop-mapreduce-project/src/contrib/raid/bin/start-raidnode.sh @@ -25,7 +25,9 @@ params=$# bin=`dirname "$0"` bin=`cd "$bin"; pwd` -. "$bin"/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh # get arguments if [ $# -ge 1 ]; then diff --git a/hadoop-mapreduce-project/src/contrib/raid/bin/stop-raidnode-remote.sh b/hadoop-mapreduce-project/src/contrib/raid/bin/stop-raidnode-remote.sh index ed870ca5f2c..d185629b23b 100644 --- a/hadoop-mapreduce-project/src/contrib/raid/bin/stop-raidnode-remote.sh +++ b/hadoop-mapreduce-project/src/contrib/raid/bin/stop-raidnode-remote.sh @@ -24,7 +24,9 @@ params=$# bin=`dirname "$0"` bin=`cd "$bin"; pwd` -. "$bin"/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh # get arguments if [ $# -ge 1 ]; then diff --git a/hadoop-mapreduce-project/src/contrib/raid/bin/stop-raidnode.sh b/hadoop-mapreduce-project/src/contrib/raid/bin/stop-raidnode.sh index d207e5aefe6..02a61a87f7c 100644 --- a/hadoop-mapreduce-project/src/contrib/raid/bin/stop-raidnode.sh +++ b/hadoop-mapreduce-project/src/contrib/raid/bin/stop-raidnode.sh @@ -25,7 +25,9 @@ params=$# bin=`dirname "$0"` bin=`cd "$bin"; pwd` -. "$bin"/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin" +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh # get arguments if [ $# -ge 1 ]; then