MAPREDUCE-5621. mr-jobhistory-daemon.sh doesn't have to execute mkdir and chown all the time. Contributed by Shinichi Yamashita.

(cherry picked from commit ea3dba37cd81a238ffcca4bb41dd69089187bc11)
This commit is contained in:
Junping Du 2017-07-12 11:54:26 -07:00
parent ebb66d2038
commit 28be69ae6d

View File

@ -78,8 +78,10 @@ if [ -f "${HADOOP_CONF_DIR}/mapred-env.sh" ]; then
. "${HADOOP_CONF_DIR}/mapred-env.sh"
fi
mkdir -p "$HADOOP_MAPRED_LOG_DIR"
chown $HADOOP_MAPRED_IDENT_STRING $HADOOP_MAPRED_LOG_DIR
if [ ! -w "$HADOOP_MAPRED_LOG_DIR" ]; then
mkdir -p "$HADOOP_MAPRED_LOG_DIR"
chown "$HADOOP_MAPRED_IDENT_STRING" "$HADOOP_MAPRED_LOG_DIR"
fi
if [ "$HADOOP_MAPRED_PID_DIR" = "" ]; then
HADOOP_MAPRED_PID_DIR=/tmp