You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2013/06/28 09:32:38 UTC

svn commit: r1497668 - in /incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules: hdp-hadoop/manifests/init.pp hdp-hbase/manifests/hbase/service_check.pp

Author: swagle
Date: Fri Jun 28 07:32:38 2013
New Revision: 1497668

URL: http://svn.apache.org/r1497668
Log:
AMBARI-2518. Webhcat start failed. Additional fixes. (swagle)

Modified:
    incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp
    incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp

Modified: incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp?rev=1497668&r1=1497667&r2=1497668&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp (original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp Fri Jun 28 07:32:38 2013
@@ -368,6 +368,7 @@ define hdp-hadoop::exec-hadoop(
   $security_enabled = $hdp::params::security_enabled
   $conf_dir = $hdp-hadoop::params::conf_dir
   $hdfs_user = $hdp-hadoop::params::hdfs_user
+  $hbase_user = $hdp-hadoop::params::hbase_user
 
   if ($user == undef) {
     $run_user = $hdfs_user
@@ -379,19 +380,30 @@ define hdp-hadoop::exec-hadoop(
     if ($run_user in [$hdfs_user,'root']) {
       $keytab = "${hdp::params::keytab_path}/hdfs.headless.keytab"
       $principal = $hdfs_user
-    }  else {
+    } elsif ($run_user in [$hbase_user]) {
+      $keytab = "${hdp::params::keytab_path}/hbase.headless.keytab"
+      $principal = $hbase_user
+    } else {
       $keytab = $hdp::params::smokeuser_keytab
       $principal = $hdp::params::smokeuser
     }
-    $kinit_if_needed = "${kinit_path_local} -kt ${keytab} ${principal}; "
+    $kinit_if_needed = "su - ${run_user} -c '${kinit_path_local} -kt ${keytab} ${principal}'"
   } else {
     $kinit_if_needed = ""
   }
- 
+
   if ($echo_yes == true) {
-    $cmd = "${kinit_if_needed}yes Y | hadoop --config ${conf_dir} ${command}"
+    $cmd = "yes Y | hadoop --config ${conf_dir} ${command}"
   } else {
-    $cmd = "${kinit_if_needed}hadoop --config ${conf_dir} ${command}"
+    $cmd = "hadoop --config ${conf_dir} ${command}"
+  }
+
+  if ($kinit_if_needed != "") {
+    exec { "kinit_before_${cmd}":
+      command => $kinit_if_needed,
+      path => ['/bin'],
+      before => Hdp::Exec[$cmd]
+    }
   }
 
   hdp::exec { $cmd:

Modified: incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp?rev=1497668&r1=1497667&r2=1497668&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp (original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp Fri Jun 28 07:32:38 2013
@@ -88,7 +88,7 @@ class hdp-hbase::hbase::service_check() 
       mode => '0644',
       content => template('hdp-hbase/hbase_grant_permissions.erb')
       }
-      hdp::exec { '${smokeuser}_grant_privileges' :
+      hdp-hadoop::exec-hadoop { '${smokeuser}_grant_privileges' :
         command => $grantprivelegecmd,
         require => File[$hbase_grant_premissions_file],
         user => $hbase_user