diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 8e1ee6ac9b..d5916d3b50 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -652,6 +652,9 @@ Release 0.23.0 - Unreleased HADOOP-7715. Removed unnecessary security logger configuration. (Eric Yang) + HADOOP-7685. Improved directory ownership check function in + hadoop-setup-conf.sh. (Eric Yang) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-conf.sh b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-conf.sh index 3590507c36..0dd6e92988 100644 --- a/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-conf.sh +++ b/hadoop-common-project/hadoop-common/src/main/packages/hadoop-setup-conf.sh @@ -60,9 +60,11 @@ check_permission() { OWNER="0" RESULT=0 while [ "$TARGET" != "/" ]; do - PARENT=`dirname $TARGET` - NAME=`basename $TARGET` - OWNER=`ls -ln $PARENT | grep $NAME| awk '{print $3}'` + if [ "`uname`" = "Darwin" ]; then + OWNER=`stat -f %u $TARGET` + else + OWNER=`stat -c %u $TARGET` + fi if [ "$OWNER" != "0" ]; then RESULT=1 break @@ -247,6 +249,7 @@ AUTOSETUP=${AUTOSETUP:-1} JAVA_HOME=${JAVA_HOME:-/usr/java/default} HADOOP_GROUP=${HADOOP_GROUP:-hadoop} HADOOP_NN_HOST=${HADOOP_NN_HOST:-`hostname`} +HADOOP_SNN_HOST=${HADOOP_SNN_HOST:-`hostname`} HADOOP_NN_DIR=${HADOOP_NN_DIR:-/var/lib/hadoop/hdfs/namenode} HADOOP_DN_DIR=${HADOOP_DN_DIR:-/var/lib/hadoop/hdfs/datanode} HADOOP_JT_HOST=${HADOOP_JT_HOST:-`hostname`} @@ -273,7 +276,7 @@ if [ "${SECURITY_TYPE}" = "kerberos" ]; then HADOOP_SECURE_DN_USER=${HADOOP_HDFS_USER} else TASK_CONTROLLER="org.apache.hadoop.mapred.DefaultTaskController" - HADDOP_DN_ADDR="0.0.0.0:50010" + HADOOP_DN_ADDR="0.0.0.0:50010" HADOOP_DN_HTTP_ADDR="0.0.0.0:50075" SECURITY="false" HADOOP_SECURE_DN_USER=""