Browse Source

HADOOP-6630. hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path. Contributed by Allen Wittenauer.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@939510 13f79535-47bb-0310-9956-ffa450edef68
Thomas White 15 years ago
parent
commit
f8f275c1ad

+ 3 - 0
CHANGES.txt

@@ -382,6 +382,9 @@ Trunk (unreleased changes)
     HADOOP-6709. Re-instate deprecated FileSystem methods that were removed
     HADOOP-6709. Re-instate deprecated FileSystem methods that were removed
     after 0.20. (tomwhite)
     after 0.20. (tomwhite)
  
  
+    HADOOP-6630. hadoop-config.sh fails to get executed if hadoop wrapper
+    scripts are in path. (Allen Wittenauer via tomwhite)
+
 Release 0.21.0 - Unreleased
 Release 0.21.0 - Unreleased
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 1 - 1
bin/hadoop-config.sh

@@ -19,7 +19,7 @@
 
 
 # resolve links - $0 may be a softlink
 # resolve links - $0 may be a softlink
 
 
-this="$0"
+this="${BASH_SOURCE-$0}"
 while [ -h "$this" ]; do
 while [ -h "$this" ]; do
   ls=`ls -ld "$this"`
   ls=`ls -ld "$this"`
   link=`expr "$ls" : '.*-> \(.*\)$'`
   link=`expr "$ls" : '.*-> \(.*\)$'`

+ 1 - 1
bin/hadoop-daemon.sh

@@ -36,7 +36,7 @@ if [ $# -le 1 ]; then
   exit 1
   exit 1
 fi
 fi
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hadoop-config.sh
 . "$bin"/hadoop-config.sh

+ 1 - 1
bin/hadoop-daemons.sh

@@ -26,7 +26,7 @@ if [ $# -le 1 ]; then
   exit 1
   exit 1
 fi
 fi
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . $bin/hadoop-config.sh
 . $bin/hadoop-config.sh

+ 1 - 1
bin/rcc

@@ -27,7 +27,7 @@
 #   HADOOP_CONF_DIR  Alternate conf dir. Default is ${HADOOP_HOME}/conf.
 #   HADOOP_CONF_DIR  Alternate conf dir. Default is ${HADOOP_HOME}/conf.
 #
 #
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hadoop-config.sh
 . "$bin"/hadoop-config.sh

+ 1 - 1
bin/slaves.sh

@@ -35,7 +35,7 @@ if [ $# -le 0 ]; then
   exit 1
   exit 1
 fi
 fi
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hadoop-config.sh
 . "$bin"/hadoop-config.sh

+ 1 - 1
bin/start-all.sh

@@ -20,7 +20,7 @@
 
 
 echo "This script is Deprecated. Instead use start-dfs.sh and start-mapred.sh"
 echo "This script is Deprecated. Instead use start-dfs.sh and start-mapred.sh"
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hadoop-config.sh
 . "$bin"/hadoop-config.sh

+ 1 - 1
bin/start-balancer.sh

@@ -15,7 +15,7 @@
 # See the License for the specific language governing permissions and
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # limitations under the License.
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hdfs-config.sh
 . "$bin"/hdfs-config.sh

+ 1 - 1
bin/start-dfs.sh

@@ -22,7 +22,7 @@
 
 
 usage="Usage: start-dfs.sh [-upgrade|-rollback]"
 usage="Usage: start-dfs.sh [-upgrade|-rollback]"
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hdfs-config.sh
 . "$bin"/hdfs-config.sh

+ 1 - 1
bin/start-mapred.sh

@@ -18,7 +18,7 @@
 
 
 # Start hadoop map reduce daemons.  Run this on master node.
 # Start hadoop map reduce daemons.  Run this on master node.
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . $bin/mapred-config.sh
 . $bin/mapred-config.sh

+ 1 - 1
bin/stop-all.sh

@@ -20,7 +20,7 @@
 
 
 echo "This script is Deprecated. Instead use stop-dfs.sh and stop-mapred.sh"
 echo "This script is Deprecated. Instead use stop-dfs.sh and stop-mapred.sh"
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hadoop-config.sh
 . "$bin"/hadoop-config.sh

+ 1 - 1
bin/stop-balancer.sh

@@ -15,7 +15,7 @@
 # See the License for the specific language governing permissions and
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # limitations under the License.
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hdfs-config.sh
 . "$bin"/hdfs-config.sh

+ 1 - 1
bin/stop-dfs.sh

@@ -18,7 +18,7 @@
 
 
 # Stop hadoop DFS daemons.  Run this on master node.
 # Stop hadoop DFS daemons.  Run this on master node.
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . "$bin"/hdfs-config.sh
 . "$bin"/hdfs-config.sh

+ 1 - 1
bin/stop-mapred.sh

@@ -18,7 +18,7 @@
 
 
 # Stop hadoop map reduce daemons.  Run this on master node.
 # Stop hadoop map reduce daemons.  Run this on master node.
 
 
-bin=`dirname "$0"`
+bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 bin=`cd "$bin"; pwd`
 
 
 . $bin/mapred-config.sh
 . $bin/mapred-config.sh