hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpit Agarwal (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-14976) Allow overriding HADOOP_SHELL_EXECNAME
Date Mon, 30 Oct 2017 16:50:00 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-14976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Arpit Agarwal updated HADOOP-14976:
    Attachment: HADOOP-14976.01.patch

The v01 patch hard-codes {{HADOOP_SHELL_EXECNAME}} for hadoop, hdfs, mapred and yarn. Checked
there are no other scripts that need to be fixed via source scan and from https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/UnixShellGuide.html.

The remaining scripts that reference {{HADOOP_SHELL_EXECNAME}} like hadoop-distcp.sh, hadoop-streaming.sh
etc. all depend on it being initialized in the calling script.

I ran shelltests locally. I couldn't think of any shell unit tests that need to be added as
part of this change.

> Allow overriding HADOOP_SHELL_EXECNAME
> --------------------------------------
>                 Key: HADOOP-14976
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14976
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Arpit Agarwal
>         Attachments: HADOOP-14976.01.patch
> Some Hadoop shell scripts infer their own name using this bit of shell magic:
> {code}
>  18     MYNAME="${BASH_SOURCE-$0}"
> {code}
> e.g. see the [hdfs|https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs#L18]
> The inferred shell script name is later passed to _hadoop-functions.sh_ which uses it
to construct the names of some environment variables. E.g. when invoking _hdfs datanode_,
the options variable name is inferred as follows:
> {code}
> {code}
> This works well if the calling script name is standard {{hdfs}} or {{yarn}}. If a distribution
renames the script to something like foo.bar, , then the variable names will be inferred as
{{FOO.BAR_DATANODE_OPTS}}. This is not a valid bash variable name.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org

View raw message