Selaa lähdekoodia

AMBARI-5537. Fix Oozie failing on Ubuntu (aonishuk)

Andrew Onishuk 11 vuotta sitten
vanhempi
commit
3ad84982ea

+ 4 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/metainfo.xml

@@ -80,6 +80,10 @@
               <type>rpm</type>
               <name>extjs</name>
             </package>
+            <package>
+              <type>rpm</type>
+              <name>libxml2-utils</name>
+            </package>
           </packages>
         </osSpecific>
         

+ 14 - 2
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/files/oozieSmoke2.sh

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 #
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -19,6 +19,10 @@
 # under the License.
 #
 #
+
+os_family=$1
+shift
+
 function getValueFromField {
   xmllint $1 | grep "<name>$2</name>" -C 2 | grep '<value>' | cut -d ">" -f2 | cut -d "<" -f1
   return $?
@@ -64,7 +68,15 @@ export OOZIE_EXIT_CODE=0
 export JOBTRACKER=`getValueFromField ${hadoop_conf_dir}/yarn-site.xml yarn.resourcemanager.address`
 export NAMENODE=`getValueFromField ${hadoop_conf_dir}/core-site.xml fs.defaultFS`
 export OOZIE_SERVER=`getValueFromField ${oozie_conf_dir}/oozie-site.xml oozie.base.url | tr '[:upper:]' '[:lower:]'`
-export OOZIE_EXAMPLES_DIR=`rpm -ql oozie-client | grep 'oozie-examples.tar.gz$' | xargs dirname`
+
+if [ "$os_family" == "debian" ] ; then
+  LIST_PACKAGE_FILES_CMD='dpkg-query -L'
+else
+  LIST_PACKAGE_FILES_CMD='rpm -ql'
+fi
+  
+
+export OOZIE_EXAMPLES_DIR=`$LIST_PACKAGE_FILES_CMD oozie-client | grep 'oozie-examples.tar.gz$' | xargs dirname`
 cd $OOZIE_EXAMPLES_DIR
 
 tar -zxf oozie-examples.tar.gz

+ 4 - 2
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/service_check.py

@@ -40,10 +40,12 @@ def oozie_smoke_shell_file(
     mode = 0755
   )
   
+  os_family = System.get_instance().os_family
+  
   if params.security_enabled:
-    sh_cmd = format("sh /tmp/{file_name} {conf_dir} {hadoop_conf_dir} {smokeuser} {security_enabled} {smokeuser_keytab} {kinit_path_local}")
+    sh_cmd = format("/tmp/{file_name} {os_family} {conf_dir} {hadoop_conf_dir} {smokeuser} {security_enabled} {smokeuser_keytab} {kinit_path_local}")
   else:
-    sh_cmd = format("sh /tmp/{file_name} {conf_dir} {hadoop_conf_dir} {smokeuser} {security_enabled}")
+    sh_cmd = format("/tmp/{file_name} {os_family} {conf_dir} {hadoop_conf_dir} {smokeuser} {security_enabled}")
 
   Execute( format("/tmp/{file_name}"),
     command   = sh_cmd,