hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1453053 - in /hadoop/common/branches/branch-1: CHANGES.txt bin/hadoop
Date Tue, 05 Mar 2013 22:43:27 GMT
Author: suresh
Date: Tue Mar  5 22:43:26 2013
New Revision: 1453053

URL: http://svn.apache.org/r1453053
Log:
HDFS-4519. Support overriding jsvc binary and log file locations when launching secure datanode.
Contributed by Chris Nauroth.

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/bin/hadoop

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1453053&r1=1453052&r2=1453053&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Tue Mar  5 22:43:26 2013
@@ -177,6 +177,10 @@ Release 1.2.0 - unreleased
     HDFS-4518. Finer grained metrics for HDFS capacity.
     (Arpit Agarwal via suresh)
 
+    HDFS-4519. Support overriding jsvc binary and log file locations when
+    launching secure datanode. (Chris Nauroth via suresh)
+    
+
   OPTIMIZATIONS
 
     HDFS-2533. Backport: Remove needless synchronization on some FSDataSet

Modified: hadoop/common/branches/branch-1/bin/hadoop
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/bin/hadoop?rev=1453053&r1=1453052&r2=1453053&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/bin/hadoop (original)
+++ hadoop/common/branches/branch-1/bin/hadoop Tue Mar  5 22:43:26 2013
@@ -46,6 +46,13 @@
 #
 #   HADOOP_ROOT_LOGGER The root appender. Default is INFO,console
 #
+#   JSVC_HOME  home directory of jsvc binary.  Defaults to jsvc binary packaged
+#              within the Hadoop distro.
+#
+#   JSVC_OUTFILE  path to jsvc output file.  Defaults to
+#                 $HADOOP_LOG_DIR/jsvc.out.
+#
+#   JSVC_ERRFILE  path to jsvc error file.  Defaults to $HADOOP_LOG_DIR/jsvc.err.
 
 bin=`dirname "$0"`
 bin=`cd "$bin" > /dev/null; pwd`
@@ -320,12 +327,6 @@ fi
 #Determine the JAVA_PLATFORM
 JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} -Xmx32m ${HADOOP_JAVA_PLATFORM_OPTS} org.apache.hadoop.util.PlatformName
| sed -e "s/ /_/g"`
   
-if [ "$JAVA_PLATFORM" = "Linux-amd64-64" ]; then
-  JSVC_ARCH="amd64"
-else
-  JSVC_ARCH="i386"
-fi
-
 # setup 'java.library.path' for native-hadoop code if necessary
 JAVA_LIBRARY_PATH=''
 if [ -d "${HADOOP_HOME}/build/native" -o -d "${HADOOP_HOME}/lib/native" -o -e "${HADOOP_PREFIX}/lib/libhadoop.a"
]; then
@@ -379,14 +380,33 @@ if [ "$starting_secure_dn" = "true" ]; t
     HADOOP_SECURE_DN_PID="$HADOOP_PID_DIR/hadoop_secure_dn.pid"
   fi
 
-  exec "$HADOOP_HOME/libexec/jsvc.${JSVC_ARCH}" -Dproc_$COMMAND -outfile "$HADOOP_LOG_DIR/jsvc.out"
\
-                                                -errfile "$HADOOP_LOG_DIR/jsvc.err" \
-                                                -pidfile "$HADOOP_SECURE_DN_PID" \
-                                                -nodetach \
-                                                -user "$HADOOP_SECURE_DN_USER" \
-                                                -cp "$CLASSPATH" \
-                                                $JAVA_HEAP_MAX $HADOOP_OPTS \
-                                                org.apache.hadoop.hdfs.server.datanode.SecureDataNodeStarter
"$@"
+  if [[ $JSVC_HOME ]]; then
+    JSVC="$JSVC_HOME/jsvc"
+  else
+    if [ "$JAVA_PLATFORM" = "Linux-amd64-64" ]; then
+      JSVC_ARCH="amd64"
+    else
+      JSVC_ARCH="i386"
+    fi
+    JSVC="$HADOOP_HOME/libexec/jsvc.${JSVC_ARCH}"
+  fi
+
+  if [[ ! $JSVC_OUTFILE ]]; then
+    JSVC_OUTFILE="$HADOOP_LOG_DIR/jsvc.out"
+  fi
+
+  if [[ ! $JSVC_ERRFILE ]]; then
+    JSVC_ERRFILE="$HADOOP_LOG_DIR/jsvc.err"
+  fi
+
+  exec "$JSVC" -Dproc_$COMMAND -outfile "$JSVC_OUTFILE" \
+               -errfile "$JSVC_ERRFILE" \
+               -pidfile "$HADOOP_SECURE_DN_PID" \
+               -nodetach \
+               -user "$HADOOP_SECURE_DN_USER" \
+               -cp "$CLASSPATH" \
+               $JAVA_HEAP_MAX $HADOOP_OPTS \
+               org.apache.hadoop.hdfs.server.datanode.SecureDataNodeStarter "$@"
 else
   # run it
   exec "$JAVA" -Dproc_$COMMAND $JAVA_HEAP_MAX $HADOOP_OPTS -classpath "$CLASSPATH" $CLASS
"$@"



Mime
View raw message