hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1239752 - /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh
Date Thu, 02 Feb 2012 18:45:08 GMT
Author: eli
Date: Thu Feb  2 18:45:07 2012
New Revision: 1239752

URL: http://svn.apache.org/viewvc?rev=1239752&view=rev
Log:
HADOOP-8012. hadoop-daemon.sh and yarn-daemon.sh are trying to mkdir and chown log/pid dirs
which can fail. Contributed by Roman Shaposhnik

Modified:
    hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh

Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh?rev=1239752&r1=1239751&r2=1239752&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh Thu Feb  2
18:45:07 2012
@@ -78,8 +78,11 @@ fi
 if [ "$YARN_LOG_DIR" = "" ]; then
   export YARN_LOG_DIR="$YARN_HOME/logs"
 fi
-mkdir -p "$YARN_LOG_DIR"
-chown $YARN_IDENT_STRING $YARN_LOG_DIR 
+
+if [ ! -w "$YARN_LOG_DIR" ] ; then
+  mkdir -p "$YARN_LOG_DIR"
+  chown $YARN_IDENT_STRING $YARN_LOG_DIR 
+fi
 
 if [ "$YARN_PID_DIR" = "" ]; then
   YARN_PID_DIR=/tmp
@@ -101,7 +104,7 @@ case $startStop in
 
   (start)
 
-    mkdir -p "$YARN_PID_DIR"
+    [ -w "$YARN_PID_DIR" ] || mkdir -p "$YARN_PID_DIR"
 
     if [ -f $pid ]; then
       if kill -0 `cat $pid` > /dev/null 2>&1; then



Mime
View raw message