HADOOP-7802. Hadoop scripts unconditionally source "$bin"/../libexec/hadoop-config.sh. Contributed by Bruno Mahé

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1203449 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas White 2011-11-18 00:48:54 +00:00
parent 0864ef1908
commit 41cfb68419
14 changed files with 43 additions and 13 deletions

View File

@ -110,6 +110,9 @@ Release 0.23.1 - Unreleased
HADOOP-7801. HADOOP_PREFIX cannot be overriden. (Bruno Mahé via tomwhite) 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 OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -21,7 +21,9 @@ bin=`which $0`
bin=`dirname ${bin}` bin=`dirname ${bin}`
bin=`cd "$bin"; pwd` 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(){ function print_usage(){
echo "Usage: hadoop [--config confdir] COMMAND" echo "Usage: hadoop [--config confdir] COMMAND"

View File

@ -39,7 +39,9 @@ fi
bin=`dirname "${BASH_SOURCE-$0}"` bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd` 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 # get arguments

View File

@ -29,6 +29,8 @@ fi
bin=`dirname "${BASH_SOURCE-$0}"` bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd` 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 "$@" exec "$bin/slaves.sh" --config $HADOOP_CONF_DIR cd "$HADOOP_PREFIX" \; "$bin/hadoop-daemon.sh" --config $HADOOP_CONF_DIR "$@"

View File

@ -30,7 +30,9 @@
bin=`dirname "${BASH_SOURCE-$0}"` bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd` 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 if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
. "${HADOOP_CONF_DIR}/hadoop-env.sh" . "${HADOOP_CONF_DIR}/hadoop-env.sh"

View File

@ -38,7 +38,9 @@ fi
bin=`dirname "${BASH_SOURCE-$0}"` bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd` 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 if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
. "${HADOOP_CONF_DIR}/hadoop-env.sh" . "${HADOOP_CONF_DIR}/hadoop-env.sh"

View File

@ -23,7 +23,9 @@ echo "This script is Deprecated. Instead use start-dfs.sh and start-mapred.sh"
bin=`dirname "${BASH_SOURCE-$0}"` bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd` 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 # start hdfs daemons if hdfs is present
if [ -f "${HADOOP_HDFS_HOME}"/bin/start-dfs.sh ]; then if [ -f "${HADOOP_HDFS_HOME}"/bin/start-dfs.sh ]; then

View File

@ -23,7 +23,9 @@ echo "This script is Deprecated. Instead use stop-dfs.sh and stop-mapred.sh"
bin=`dirname "${BASH_SOURCE-$0}"` bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd` 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 # stop hdfs daemons if hdfs is present
if [ -f "${HADOOP_HDFS_HOME}"/bin/stop-dfs.sh ]; then if [ -f "${HADOOP_HDFS_HOME}"/bin/stop-dfs.sh ]; then

View File

@ -24,7 +24,9 @@ if [ "$HADOOP_HOME" != "" ]; then
echo echo
fi 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() { usage() {
echo " echo "

View File

@ -19,7 +19,9 @@ bin=$(cd -P -- "$(dirname -- "$this")" && pwd -P)
script="$(basename -- "$this")" script="$(basename -- "$this")"
this="$bin/$script" 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() { usage() {
echo " echo "

View File

@ -504,7 +504,10 @@ if [ "${AUTOSETUP}" == "1" -o "${AUTOSETUP}" == "y" ]; then
fi fi
chmod 755 -R ${HADOOP_PREFIX}/sbin/*hadoop* chmod 755 -R ${HADOOP_PREFIX}/sbin/*hadoop*
chmod 755 -R ${HADOOP_PREFIX}/bin/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} mkdir -p /home/${HADOOP_MR_USER}
chown ${HADOOP_MR_USER}:${HADOOP_GROUP} /home/${HADOOP_MR_USER} chown ${HADOOP_MR_USER}:${HADOOP_GROUP} /home/${HADOOP_MR_USER}
HDFS_DIR=`echo ${HADOOP_HDFS_DIR} | sed -e 's/,/ /g'` HDFS_DIR=`echo ${HADOOP_HDFS_DIR} | sed -e 's/,/ /g'`

View File

@ -18,7 +18,9 @@
bin=`dirname "$0"` bin=`dirname "$0"`
bin=`cd "$bin"; pwd` 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() { usage() {
echo " echo "

View File

@ -25,7 +25,9 @@ if [ "$HADOOP_HOME" != "" ]; then
echo echo
fi 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() { usage() {
echo " echo "

View File

@ -31,7 +31,9 @@
bin=`dirname "$0"` bin=`dirname "$0"`
bin=`cd "$bin"; pwd` 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() { usage() {
echo " echo "