Updated Branches: refs/heads/master e37478572 -> 9c83eb0d7
HDFS-1943. fail to start datanode while start-dfs.sh is executed by root user Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/9c83eb0d Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/9c83eb0d Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/9c83eb0d Branch: refs/heads/master Commit: 9c83eb0d7cff800d5aa7536d5059f91916213fdf Parents: e374785 Author: Roman Shaposhnik <[email protected]> Authored: Thu Dec 6 17:44:49 2012 -0800 Committer: Roman Shaposhnik <[email protected]> Committed: Thu Dec 6 17:44:49 2012 -0800 ---------------------------------------------------------------------- .../src/common/hadoop/hadoop-hdfs-datanode.svc | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/9c83eb0d/bigtop-packages/src/common/hadoop/hadoop-hdfs-datanode.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hadoop/hadoop-hdfs-datanode.svc b/bigtop-packages/src/common/hadoop/hadoop-hdfs-datanode.svc index d9ca930..5d4d71b 100644 --- a/bigtop-packages/src/common/hadoop/hadoop-hdfs-datanode.svc +++ b/bigtop-packages/src/common/hadoop/hadoop-hdfs-datanode.svc @@ -31,20 +31,10 @@ start() { [ -d $CONF_DIR ] || exit $ERROR_PROGRAM_NOT_CONFIGURED log_success_msg "Starting ${DESC}: " - TARGET_USER_NAME="HADOOP_`echo datanode | tr a-z A-Z`_USER" - TARGET_USER=$(eval "echo \$$TARGET_USER_NAME") - - # The following needs to be removed once HDFS-1943 gets finally put to rest. - # The logic of this ugly hack is this: IFF we do NOT have jsvc installed it is - # guaranteed that we can NOT be running in a secure mode and thus we need to - # workaround HDFS-1943 (start as non-root). As soon as jsvc gets installed - # we are assuming a secure installation and starting a data node as root. - # This leaves 2 corner cases: - # 1. HADOOP_DATANODE_USER being set to root - # 2. jsvc is installed but Hadoop is configures to run in an unsecure mode - # Both will currently fail if [ -n "$HADOOP_SECURE_DN_USER" ]; then TARGET_USER=root + else + TARGET_USER=${HADOOP_DATANODE_USER:-hdfs} fi export HADOOP_IDENT_STRING=$TARGET_USER
