[ 
https://issues.apache.org/jira/browse/HADOOP-10996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14106321#comment-14106321
 ] 

Allen Wittenauer commented on HADOOP-10996:
-------------------------------------------

OK, hdfs-config.sh does to the right thing:

{code}
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_HOME}/libexec/hadoop-config.sh" ]; then
  . "${HADOOP_HOME}/libexec/hadoop-config.sh"
else
  echo "ERROR: Hadoop common not found." 2>&1
  exit 1
fi
{code}

So it's really hadoop-config.sh that's broken here:

{code}
# get our functions defined for usage later
if [[ -f "${HADOOP_LIBEXEC_DIR}/hadoop-functions.sh" ]]; then
  . "${HADOOP_LIBEXEC_DIR}/hadoop-functions.sh"
else
  echo "ERROR: Unable to exec ${HADOOP_LIBEXEC_DIR}/hadoop-functions.sh." 1>&2
  exit 1
fi

# allow overrides of the above and pre-defines of the below
if [[ -f "${HADOOP_LIBEXEC_DIR}/hadoop-layout.sh" ]]; then
  . "${HADOOP_LIBEXEC_DIR}/hadoop-layout.sh"
fi
{code}

This is going to be a relatively easy fix, I think.  We just need to add checks 
for HADOOP_COMMON_HOME prior to using HADOOP_LIBEXEC_DIR.

> run hdfs, yarn, mapred, etc from target tree
> --------------------------------------------
>
>                 Key: HADOOP-10996
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10996
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 3.0.0
>            Reporter: Allen Wittenauer
>
> There is a developer use case for running the shell scripts from the build 
> tree.  What would it take to make it work?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to