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

This commit is contained in:
Junping Du 2017-07-12 11:54:26 -07:00
parent f2d440b3b3
commit ea3dba37cd
1 changed files with 4 additions and 2 deletions

View File

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