hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From junping...@apache.org
Subject hadoop git commit: MAPREDUCE-5621. mr-jobhistory-daemon.sh doesn't have to execute mkdir and chown all the time. Contributed by Shinichi Yamashita.
Date Wed, 12 Jul 2017 18:54:37 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 f2d440b3b -> ea3dba37c


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


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ea3dba37
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ea3dba37
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ea3dba37

Branch: refs/heads/branch-2
Commit: ea3dba37cd81a238ffcca4bb41dd69089187bc11
Parents: f2d440b
Author: Junping Du <junping_du@apache.org>
Authored: Wed Jul 12 11:54:26 2017 -0700
Committer: Junping Du <junping_du@apache.org>
Committed: Wed Jul 12 11:54:26 2017 -0700

----------------------------------------------------------------------
 hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ea3dba37/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh b/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh
index 7585c9a8..629501d 100644
--- a/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh
+++ b/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message