Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
Some Hadoop shell scripts infer their own name using this bit of shell magic:
18 MYNAME="${BASH_SOURCE-$0}" 19 HADOOP_SHELL_EXECNAME="${MYNAME##*/}"
e.g. see the hdfs script.
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:
# HDFS + DATANODE + OPTS -> HDFS_DATANODE_OPTS
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.