You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2013/06/05 18:54:15 UTC

svn commit: r1489953 - in /incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie: files/wrap_ooziedb.sh manifests/service.pp

Author: mahadev
Date: Wed Jun  5 16:54:15 2013
New Revision: 1489953

URL: http://svn.apache.org/r1489953
Log:
AMBARI-2287. The user can get stuck in installation failure loop. (Dmitry L via mahadev)

Added:
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/files/wrap_ooziedb.sh
Modified:
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp

Added: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/files/wrap_ooziedb.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/files/wrap_ooziedb.sh?rev=1489953&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/files/wrap_ooziedb.sh (added)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/files/wrap_ooziedb.sh Wed Jun  5 16:54:15 2013
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+OUT=`cd /var/tmp/oozie && /usr/lib/oozie/bin/ooziedb.sh "$@" 2>&1`
+EC=$?
+echo $OUT
+GRVAR=`echo ${OUT} | grep -o "java.lang.Exception: DB schema exists"`
+if [ ${EC} -ne 0 ] && [ -n "$GRVAR" ]
+then
+  exit 0
+else
+  exit $EC
+fi  

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp?rev=1489953&r1=1489952&r2=1489953&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/service.pp Wed Jun  5 16:54:15 2013
@@ -56,6 +56,11 @@ class hdp-oozie::service(
       $jdbc_driver_jar_target = "${libext_dir}/${oracle_driver_jar_name}"
   }
   
+  file { '/tmp/wrap_ooziedb.sh':
+    ensure => present,
+    source => "puppet:///modules/hdp-oozie/wrap_ooziedb.sh",
+    mode => '0755'
+  }
   
 
   if ($security == true) {
@@ -91,7 +96,7 @@ class hdp-oozie::service(
         /(com.mysql.jdbc.Driver|oracle.jdbc.driver.OracleDriver)/ => "cd ${oozie_tmp} && /usr/lib/oozie/bin/oozie-setup.sh -hadoop 0.20.200 $jar_location -extjs $ext_js_path $jar_option $jar_path && cp $jdbc_driver_jar $jdbc_driver_jar_target",
         default            => "cd ${oozie_tmp} && /usr/lib/oozie/bin/oozie-setup.sh -hadoop 0.20.200 $jar_location -extjs $ext_js_path $jar_option $jar_path",
   }
-  $cmd5 =  "cd ${oozie_tmp} && /usr/lib/oozie/bin/ooziedb.sh create -sqlfile oozie.sql -run "
+  $cmd5 =  "/tmp/wrap_ooziedb.sh create -sqlfile oozie.sql -run "
   $cmd6 =  "su - ${user} -c '${kinit_if_needed}; hadoop dfs -put /usr/lib/oozie/share ${oozie_hdfs_user_dir} ; hadoop dfs -chmod -R 755 ${oozie_hdfs_user_dir}/share'"
   #$cmd7 = "/usr/lib/oozie/bin/oozie-start.sh"