Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C30D110EC3 for ; Wed, 14 Aug 2013 19:35:00 +0000 (UTC) Received: (qmail 45123 invoked by uid 500); 14 Aug 2013 19:34:58 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 44055 invoked by uid 500); 14 Aug 2013 19:34:50 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 43647 invoked by uid 99); 14 Aug 2013 19:34:47 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Aug 2013 19:34:47 +0000 Date: Wed, 14 Aug 2013 19:34:47 +0000 (UTC) From: "Kai Zheng (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HADOOP-9873) hadoop-env.sh got called multiple times MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Kai Zheng created HADOOP-9873: --------------------------------- Summary: hadoop-env.sh got called multiple times Key: HADOOP-9873 URL: https://issues.apache.org/jira/browse/HADOOP-9873 Project: Hadoop Common Issue Type: Bug Components: scripts Reporter: Kai Zheng Assignee: Kai Zheng Priority: Minor Ref. below, it can be seen hadoop-env.sh got called multiple times when running something like 'hadoop-daemon.sh start namenode'. {noformat} [drankye@zkdev ~]$ cd $HADOOP_PREFIX [drankye@zkdev hadoop-3.0.0-SNAPSHOT]$ grep -r hadoop-env * libexec/hadoop-config.sh:if [ -e "${HADOOP_PREFIX}/conf/hadoop-env.sh" ]; then libexec/hadoop-config.sh:if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then libexec/hadoop-config.sh: . "${HADOOP_CONF_DIR}/hadoop-env.sh" sbin/hadoop-daemon.sh:if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then sbin/hadoop-daemon.sh: . "${HADOOP_CONF_DIR}/hadoop-env.sh" {noformat} Considering the following lines in hadoop-env.sh {code} # Command specific options appended to HADOOP_OPTS when specified export HADOOP_NAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_NAMENODE_OPTS" {code} It may end with some redundant result like below when called multiple times. {noformat} HADOOP_NAMENODE_OPTS='-Dhadoop.security.logger=INFO,RFAS -Dhdfs.audit.logger=INFO,NullAppender -Dhadoop.security.logger=INFO,RFAS -Dhdfs.audit.logger=INFO,NullAppender ' {noformat} It's not a big issue for now however it would be better to be clean and avoid this since it can cause the final JAVA command line is very lengthy and hard to read. A possible fix would be to add a flag variable like HADOOP_ENV_INITED in hadoop-env.sh, and then at the beginning of it check the flag. If the flag evaluates true, then return immediately. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira