From 4f6708103859dac1b1d25180a4b16727d2aaca63 Mon Sep 17 00:00:00 2001 From: avijayanhwx <14299376+avijayanhwx@users.noreply.github.com> Date: Mon, 16 Sep 2019 22:36:53 -0700 Subject: [PATCH] =?UTF-8?q?HDDS-2098=20:=20Ozone=20shell=20command=20print?= =?UTF-8?q?s=20out=20ERROR=20when=20the=20log4j=20file=20=E2=80=A6=20(#141?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hadoop-ozone/common/src/main/bin/ozone | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/common/src/main/bin/ozone b/hadoop-ozone/common/src/main/bin/ozone index 47258d2ba0..e257519dce 100755 --- a/hadoop-ozone/common/src/main/bin/ozone +++ b/hadoop-ozone/common/src/main/bin/ozone @@ -69,6 +69,12 @@ function ozonecmd_case subcmd=$1 shift + ozone_default_log4j="${HADOOP_CONF_DIR}/log4j.properties" + ozone_shell_log4j="${HADOOP_CONF_DIR}/ozone-shell-log4j.properties" + if [ ! -f "${ozone_shell_log4j}" ]; then + ozone_shell_log4j=${ozone_default_log4j} + fi + case ${subcmd} in auditparser) HADOOP_CLASSNAME=org.apache.hadoop.ozone.audit.parser.AuditParser @@ -118,7 +124,7 @@ function ozonecmd_case ;; freon) HADOOP_CLASSNAME=org.apache.hadoop.ozone.freon.Freon - OZONE_FREON_OPTS="${OZONE_FREON_OPTS} -Dhadoop.log.file=ozone-freon.log -Dlog4j.configuration=file:${HADOOP_CONF_DIR}/ozone-shell-log4j.properties" + OZONE_FREON_OPTS="${OZONE_FREON_OPTS} -Dhadoop.log.file=ozone-freon.log -Dlog4j.configuration=file:${ozone_shell_log4j}" HADOOP_OPTS="${HADOOP_OPTS} ${OZONE_FREON_OPTS}" OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-tools" ;; @@ -139,7 +145,8 @@ function ozonecmd_case ;; sh | shell) HADOOP_CLASSNAME=org.apache.hadoop.ozone.web.ozShell.OzoneShell - HDFS_OM_SH_OPTS="${HDFS_OM_SH_OPTS} -Dhadoop.log.file=ozone-shell.log -Dlog4j.configuration=file:${HADOOP_CONF_DIR}/ozone-shell-log4j.properties" + HDFS_OM_SH_OPTS="${HDFS_OM_SH_OPTS} -Dhadoop.log.file=ozone-shell.log + -Dlog4j.configuration=file:${ozone_shell_log4j}" HADOOP_OPTS="${HADOOP_OPTS} ${HDFS_OM_SH_OPTS}" OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-ozone-manager" ;;