Преглед изворни кода

HDFS-2289. Ensure jsvc is bundled with the HDFS distribution artifact. Contributed by Alejandro Abdelnur.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1162421 13f79535-47bb-0310-9956-ffa450edef68
Arun Murthy пре 13 година
родитељ
комит
8b56463315

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -1003,6 +1003,9 @@ Release 0.23.0 - Unreleased
     HDFS-2286. DataXceiverServer logs AsynchronousCloseException at shutdown
     (todd)
 
+    HDFS-2289. Ensure jsvc is bundled with the HDFS distribution artifact.
+    (Alejandro Abdelnur via acmurthy) 
+
   BREAKDOWN OF HDFS-1073 SUBTASKS
 
     HDFS-1521. Persist transaction ID on disk between NN restarts.

+ 50 - 0
hadoop-hdfs-project/hadoop-hdfs/pom.xml

@@ -299,6 +299,56 @@
           </excludes>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>xprepare-package-hadoop-daemon</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target>
+                <condition property="commons.daemon.os.name" value="darwin">
+                    <os name="Mac OS X"/>
+                </condition>
+                <condition property="commons.daemon.os.arch" value="universal">
+                    <os name="Mac OS X"/>
+                </condition>
+                <condition property="commons.daemon.os.name" value="linux">
+                    <os name="Linux" />
+                </condition>
+                <!-- Set commons.daemon.os.arch to either i686 or x86_64 for GNU/Linux -->
+                <condition property="commons.daemon.os.arch" value="x86_64">
+                    <os name="Linux" arch="amd64"/>
+                </condition>
+                <condition property="commons.daemon.os.arch" value="i686">
+                    <os name="Linux" /> <!-- This is a guess -->
+                </condition>
+                <property name="commons.daemon.tar.name"
+                          value="commons-daemon-${commons-daemon.version}-bin-${commons.daemon.os.name}-${commons.daemon.os.arch}.tar.gz"/>
+               
+                <property name="commons.daemon.download.dir"
+                          value="${project.build.directory}/downloads/commons-daemon"/>
+                <delete dir="${commons.daemon.download.dir}"/>
+                <mkdir dir="${commons.daemon.download.dir}"/>
+                <get src="http://archive.apache.org/dist/commons/daemon/binaries/${commons-daemon.version}/${commons.daemon.os.name}/${commons.daemon.tar.name}"
+                    dest="${commons.daemon.download.dir}/${commons.daemon.tar.name}" verbose="true" skipexisting="true"/>
+                <untar compression="gzip" src="${commons.daemon.download.dir}/${commons.daemon.tar.name}"
+                       dest="${commons.daemon.download.dir}"/>
+                <copy file="${commons.daemon.download.dir}/jsvc"
+                      todir="${project.build.directory}/${project.artifactId}-${project.version}/libexec"
+                      verbose="true"/>
+                <chmod perm="ugo+x" type="file">
+                  <fileset file="${project.build.directory}/${project.artifactId}-${project.version}/libexec/jsvc"/>
+                </chmod>
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs

@@ -118,7 +118,7 @@ if [ "$starting_secure_dn" = "true" ]; then
    HADOOP_SECURE_DN_PID="$HADOOP_PID_DIR/hadoop_secure_dn.pid"
   fi
 
-  exec "$HADOOP_HDFS_HOME/bin/jsvc" \
+  exec "$HADOOP_HDFS_HOME/libexec/jsvc" \
            -Dproc_$COMMAND -outfile "$HADOOP_LOG_DIR/jsvc.out" \
            -errfile "$HADOOP_LOG_DIR/jsvc.err" \
            -pidfile "$HADOOP_SECURE_DN_PID" \

+ 3 - 1
hadoop-project/pom.xml

@@ -74,6 +74,8 @@
 
     <distMgmtSnapshotsName>Apache Development Snapshot Repository</distMgmtSnapshotsName>
     <distMgmtSnapshotsUrl>https://repository.apache.org/content/repositories/snapshots</distMgmtSnapshotsUrl>
+
+    <commons-daemon.version>1.0.3</commons-daemon.version>
   </properties>
 
   <dependencyManagement>
@@ -365,7 +367,7 @@
       <dependency>
         <groupId>commons-daemon</groupId>
         <artifactId>commons-daemon</artifactId>
-        <version>1.0.1</version>
+        <version>${commons-daemon.version}</version>
       </dependency>
     </dependencies>
   </dependencyManagement>