From db9d8333b4b97be1b714414edbc04f1e294f88fa Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Mon, 25 Jul 2011 21:12:18 +0000 Subject: [PATCH] HADOOP-7438. Fix deprecated warnings from hadoop-daemon.sh script. Contributed by Ravi Prakash. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1150914 13f79535-47bb-0310-9956-ffa450edef68 --- common/CHANGES.txt | 6 +++++- common/bin/hadoop-daemon.sh | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/common/CHANGES.txt b/common/CHANGES.txt index 0b6139df840..dccc25cb3a1 100644 --- a/common/CHANGES.txt +++ b/common/CHANGES.txt @@ -350,7 +350,8 @@ Trunk (unreleased changes) HADOOP-7268. FileContext.getLocalFSFileContext() behavior needs to be fixed w.r.t tokens. (jitendra) - HADOOP-7290. Unit test failure in TestUserGroupInformation.testGetServerSideGroups. (Trevor Robison via eli) + HADOOP-7290. Unit test failure in + TestUserGroupInformation.testGetServerSideGroups. (Trevor Robison via eli) HADOOP-7292. Fix racy test case TestSinkQueue. (Luke Lu via todd) @@ -416,6 +417,9 @@ Trunk (unreleased changes) HADOOP-7111. Several TFile tests failing when native libraries are present. (atm) + HADOOP-7438. Fix deprecated warnings from hadoop-daemon.sh script. + (Ravi Prakash via suresh) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/common/bin/hadoop-daemon.sh b/common/bin/hadoop-daemon.sh index 47f82c4e98c..93fd1705693 100755 --- a/common/bin/hadoop-daemon.sh +++ b/common/bin/hadoop-daemon.sh @@ -137,7 +137,19 @@ case $startStop in hadoop_rotate_log $log echo starting $command, logging to $log cd "$HADOOP_PREFIX" - nohup nice -n $HADOOP_NICENESS $hadoopScript --config $HADOOP_CONF_DIR $command "$@" > "$log" 2>&1 < /dev/null & + case $command in + namenode|secondarynamenode|datanode|dfs|dfsadmin|fsck|balancer) + if [ -z "$HADOOP_HDFS_HOME" ]; then + hdfsScript="$HADOOP_PREFIX"/bin/hdfs + else + hdfsScript="$HADOOP_HDFS_HOME"/bin/hdfs + fi + nohup nice -n $HADOOP_NICENESS $hdfsScript --config $HADOOP_CONF_DIR $command "$@" > "$log" 2>&1 < /dev/null & + ;; + (*) + nohup nice -n $HADOOP_NICENESS $hadoopScript --config $HADOOP_CONF_DIR $command "$@" > "$log" 2>&1 < /dev/null & + ;; + esac echo $! > $pid sleep 1; head "$log" sleep 3;