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

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1239752 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2012-02-02 18:45:07 +00:00
parent 58ba16e85f
commit 1950f97ab9
3 changed files with 15 additions and 6 deletions

View File

@ -326,6 +326,9 @@ Release 0.23.1 - Unreleased
HADOOP-7999. "hadoop archive" fails with ClassNotFoundException.
(Jason Lowe via mahadev)
HADOOP-8012. hadoop-daemon.sh and yarn-daemon.sh are trying to mkdir
and chown log/pid dirs which can fail. (Roman Shaposhnik via eli)
Release 0.23.0 - 2011-11-01
INCOMPATIBLE CHANGES

View File

@ -95,8 +95,11 @@ fi
if [ "$HADOOP_LOG_DIR" = "" ]; then
export HADOOP_LOG_DIR="$HADOOP_PREFIX/logs"
fi
mkdir -p "$HADOOP_LOG_DIR"
chown $HADOOP_IDENT_STRING $HADOOP_LOG_DIR
if [ ! -w "$HADOOP_LOG_DIR" ] ; then
mkdir -p "$HADOOP_LOG_DIR"
chown $HADOOP_IDENT_STRING $HADOOP_LOG_DIR
fi
if [ "$HADOOP_PID_DIR" = "" ]; then
HADOOP_PID_DIR=/tmp
@ -118,7 +121,7 @@ case $startStop in
(start)
mkdir -p "$HADOOP_PID_DIR"
[ -w "$HADOOP_PID_DIR" ] || mkdir -p "$HADOOP_PID_DIR"
if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then

View File

@ -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