Browse Source

HDFS-4134. Namenode and Datanode entry points should return negative exit code on bad arguments. Contributed by Steve Loughran.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1407278 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 12 years ago
parent
commit
ce475e28e3

+ 5 - 2
CHANGES.txt

@@ -327,8 +327,11 @@ Release 1.1.1 - Unreleased
     directory deletion completes. It allows other operations when the 
     directory deletion completes. It allows other operations when the 
     deletion is in progress. (umamahesh via suresh)
     deletion is in progress. (umamahesh via suresh)
 
 
-    HDFS-2815. Namenode is not coming out of safemode when we perform ( NN crash + restart ). 
-    Also FSCK report shows blocks missed. (umamahesh)
+    HDFS-2815. Namenode is not coming out of safemode when we perform
+    (NN crash + restart). Also FSCK report shows blocks missed. (umamahesh)
+
+    HDFS-4134. hadoop namenode and datanode entry points should return 
+    negative exit code on bad arguments. (Steve Loughran via suresh)
 
 
 Release 1.1.0 - 2012.09.28
 Release 1.1.0 - 2012.09.28
 
 

+ 1 - 1
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java

@@ -1616,7 +1616,7 @@ public class DataNode extends Configured
       conf = new Configuration();
       conf = new Configuration();
     if (!parseArguments(args, conf)) {
     if (!parseArguments(args, conf)) {
       printUsage();
       printUsage();
-      return null;
+      System.exit(-2);
     }
     }
     if (conf.get("dfs.network.script") != null) {
     if (conf.get("dfs.network.script") != null) {
       LOG.error("This configuration for rack identification is not supported" +
       LOG.error("This configuration for rack identification is not supported" +

+ 1 - 1
src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java

@@ -1423,7 +1423,7 @@ public class NameNode implements ClientProtocol, DatanodeProtocol,
     StartupOption startOpt = parseArguments(argv);
     StartupOption startOpt = parseArguments(argv);
     if (startOpt == null) {
     if (startOpt == null) {
       printUsage();
       printUsage();
-      return null;
+      System.exit(-2);
     }
     }
     setStartupOption(conf, startOpt);
     setStartupOption(conf, startOpt);