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" ;;