diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 4ceb77dfc45..e7a206117cf 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -143,6 +143,9 @@ Trunk (Unreleased) HADOOP-10788. Rewrite kms to use new shell framework (John Smith via aw) + HADOOP-11058. Missing HADOOP_CONF_DIR generates strange results + (Masatake Iwasaki via aw) + BUG FIXES HADOOP-9451. Fault single-layer config if node group topology is enabled. diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh index 06fb0efdcc5..d9fd6e676df 100644 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh @@ -169,6 +169,7 @@ hadoop_exec_userfuncs # hadoop_exec_hadooprc +hadoop_verify_confdir # do all the OS-specific startup bits here # this allows us to get a decent JAVA_HOME, diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh index 799aad0e1b3..2d8e90ecd56 100644 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh @@ -92,6 +92,15 @@ function hadoop_find_confdir hadoop_debug "HADOOP_CONF_DIR=${HADOOP_CONF_DIR}" } +function hadoop_verify_confdir +{ + # Check only log4j.properties by default. + # --loglevel does not work without logger settings in log4j.log4j.properties. + if [[ ! -f "${HADOOP_CONF_DIR}/log4j.properties" ]]; then + hadoop_error "WARNING: log4j.properties is not found. HADOOP_CONF_DIR may be incomplete." + fi +} + function hadoop_exec_hadoopenv { # NOTE: This function is not user replaceable.