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 "