From 41cfb68419a563260aa2c99be335e8bb57be89d0 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 18 Nov 2011 00:48:54 +0000 Subject: [PATCH] =?UTF-8?q?HADOOP-7802.=20Hadoop=20scripts=20unconditional?= =?UTF-8?q?ly=20source=20"$bin"/../libexec/hadoop-config.sh.=20Contributed?= =?UTF-8?q?=20by=20Bruno=20Mah=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1203449 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ hadoop-common-project/hadoop-common/src/main/bin/hadoop | 4 +++- .../hadoop-common/src/main/bin/hadoop-daemon.sh | 4 +++- .../hadoop-common/src/main/bin/hadoop-daemons.sh | 4 +++- hadoop-common-project/hadoop-common/src/main/bin/rcc | 4 +++- hadoop-common-project/hadoop-common/src/main/bin/slaves.sh | 4 +++- .../hadoop-common/src/main/bin/start-all.sh | 4 +++- hadoop-common-project/hadoop-common/src/main/bin/stop-all.sh | 4 +++- .../hadoop-common/src/main/packages/hadoop-create-user.sh | 4 +++- .../src/main/packages/hadoop-setup-applications.sh | 4 +++- .../hadoop-common/src/main/packages/hadoop-setup-conf.sh | 5 ++++- .../hadoop-common/src/main/packages/hadoop-setup-hdfs.sh | 4 +++- .../src/main/packages/hadoop-setup-single-node.sh | 4 +++- .../hadoop-common/src/main/packages/hadoop-validate-setup.sh | 4 +++- 14 files changed, 43 insertions(+), 13 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 74d683b505..ad6db0ff84 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -110,6 +110,9 @@ Release 0.23.1 - Unreleased HADOOP-7801. HADOOP_PREFIX cannot be overriden. (Bruno Mahé via tomwhite) + HADOOP-7802. Hadoop scripts unconditionally source + "$bin"/../libexec/hadoop-config.sh. (Bruno Mahé via tomwhite) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop b/hadoop-common-project/hadoop-common/src/main/bin/hadoop index a3bed69247..9e92b5c2ce 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop @@ -21,7 +21,9 @@ bin=`which $0` bin=`dirname ${bin}` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh function print_usage(){ echo "Usage: hadoop [--config confdir] COMMAND" diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemon.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemon.sh index 01aaad4298..a843c93cbf 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemon.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemon.sh @@ -39,7 +39,9 @@ fi bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh # get arguments diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh index 08c7e23ac9..181d7ac101 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh @@ -29,6 +29,8 @@ fi bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh exec "$bin/slaves.sh" --config $HADOOP_CONF_DIR cd "$HADOOP_PREFIX" \; "$bin/hadoop-daemon.sh" --config $HADOOP_CONF_DIR "$@" diff --git a/hadoop-common-project/hadoop-common/src/main/bin/rcc b/hadoop-common-project/hadoop-common/src/main/bin/rcc index ebeebd0ee2..5f75b7c950 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/rcc +++ b/hadoop-common-project/hadoop-common/src/main/bin/rcc @@ -30,7 +30,9 @@ bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then . "${HADOOP_CONF_DIR}/hadoop-env.sh" diff --git a/hadoop-common-project/hadoop-common/src/main/bin/slaves.sh b/hadoop-common-project/hadoop-common/src/main/bin/slaves.sh index 153f4416f7..016392fedb 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/slaves.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/slaves.sh @@ -38,7 +38,9 @@ fi bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then . "${HADOOP_CONF_DIR}/hadoop-env.sh" diff --git a/hadoop-common-project/hadoop-common/src/main/bin/start-all.sh b/hadoop-common-project/hadoop-common/src/main/bin/start-all.sh index 57fb3d6c74..f91d9afef0 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/start-all.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/start-all.sh @@ -23,7 +23,9 @@ echo "This script is Deprecated. Instead use start-dfs.sh and start-mapred.sh" bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh # start hdfs daemons if hdfs is present if [ -f "${HADOOP_HDFS_HOME}"/bin/start-dfs.sh ]; then diff --git a/hadoop-common-project/hadoop-common/src/main/bin/stop-all.sh b/hadoop-common-project/hadoop-common/src/main/bin/stop-all.sh index a2b5ddb716..7d8bd591ea 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/stop-all.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/stop-all.sh @@ -23,7 +23,9 @@ echo "This script is Deprecated. Instead use stop-dfs.sh and stop-mapred.sh" bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh # stop hdfs daemons if hdfs is present if [ -f "${HADOOP_HDFS_HOME}"/bin/stop-dfs.sh ]; then diff --git a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-create-user.sh b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-create-user.sh index a5d4304af5..ad8ab35aa9 100644 --- a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-create-user.sh +++ b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-create-user.sh @@ -24,7 +24,9 @@ if [ "$HADOOP_HOME" != "" ]; then echo fi -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh usage() { echo " diff --git a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-applications.sh b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-applications.sh index 521c1599c3..092e50d468 100644 --- a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-applications.sh +++ b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-applications.sh @@ -19,7 +19,9 @@ bin=$(cd -P -- "$(dirname -- "$this")" && pwd -P) script="$(basename -- "$this")" this="$bin/$script" -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh usage() { echo " diff --git a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-conf.sh b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-conf.sh index de47ce2716..0daac37942 100644 --- a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-conf.sh +++ b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-conf.sh @@ -504,7 +504,10 @@ if [ "${AUTOSETUP}" == "1" -o "${AUTOSETUP}" == "y" ]; then fi chmod 755 -R ${HADOOP_PREFIX}/sbin/*hadoop* chmod 755 -R ${HADOOP_PREFIX}/bin/hadoop - chmod 755 -R ${HADOOP_PREFIX}/libexec/hadoop-config.sh + + HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-${HADOOP_PREFIX}/libexec} + chmod 755 -R ${HADOOP_LIBEXEC_DIR}/hadoop-config.sh + mkdir -p /home/${HADOOP_MR_USER} chown ${HADOOP_MR_USER}:${HADOOP_GROUP} /home/${HADOOP_MR_USER} HDFS_DIR=`echo ${HADOOP_HDFS_DIR} | sed -e 's/,/ /g'` diff --git a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-hdfs.sh b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-hdfs.sh index fc4a7325c2..d2e8f1f69f 100644 --- a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-hdfs.sh +++ b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-hdfs.sh @@ -18,7 +18,9 @@ bin=`dirname "$0"` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh usage() { echo " diff --git a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-single-node.sh b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-single-node.sh index 5b47e4431c..845f815f49 100644 --- a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-single-node.sh +++ b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-single-node.sh @@ -25,7 +25,9 @@ if [ "$HADOOP_HOME" != "" ]; then echo fi -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh usage() { echo " diff --git a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-validate-setup.sh b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-validate-setup.sh index 5d3aa1461e..35d8cb82fb 100644 --- a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-validate-setup.sh +++ b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-validate-setup.sh @@ -31,7 +31,9 @@ bin=`dirname "$0"` bin=`cd "$bin"; pwd` -. "$bin"/../libexec/hadoop-config.sh +DEFAULT_LIBEXEC_DIR="$bin"/../libexec +HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} +. $HADOOP_LIBEXEC_DIR/hadoop-config.sh usage() { echo "