Updated Branches: refs/heads/trunk 1f1603262 -> 6928cf3ba
AMBARI-2608. WebHCat and Oozie services does not start on RHEL5 with enabled security because of - CRITICAL: Error doing kinit for nagios. (smohanty) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/6928cf3b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/6928cf3b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/6928cf3b Branch: refs/heads/trunk Commit: 6928cf3ba6096e0f2f18c3a88ffd80c2d21d8a83 Parents: 1f16032 Author: Sumit Mohanty <[email protected]> Authored: Wed Jul 10 14:24:08 2013 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Wed Jul 10 14:24:08 2013 -0700 ---------------------------------------------------------------------- .../puppet/modules/hdp-hadoop/manifests/init.pp | 2 +- .../hdp-hcat/manifests/hcat/service_check.pp | 2 +- .../hdp-sqoop/manifests/sqoop/service_check.pp | 2 +- .../manifests/templeton/service_check.pp | 4 +-- .../parser/functions/hdp_get_kinit_path.rb | 36 ++++++++++++++++++++ .../main/puppet/modules/hdp/manifests/params.pp | 2 +- 6 files changed, 42 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6928cf3b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp index 0fca0e7..0b6f894 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp @@ -387,7 +387,7 @@ define hdp-hadoop::exec-hadoop( $keytab = $hdp::params::smokeuser_keytab $principal = $hdp::params::smokeuser } - $kinit_if_needed = "su - ${run_user} -c '${kinit_path_local} -kt ${keytab} ${principal}'" + $kinit_if_needed = "su - ${run_user} -c '${hdp::params::kinit_path_local} -kt ${keytab} ${principal}'" } else { $kinit_if_needed = "" } http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6928cf3b/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/hcat/service_check.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/hcat/service_check.pp b/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/hcat/service_check.pp index d702066..f2aabb0 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/hcat/service_check.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/hcat/service_check.pp @@ -28,7 +28,7 @@ class hdp-hcat::hcat::service_check() $smoke_user_keytab = $hdp::params::smokeuser_keytab if ($security_enabled == true) { - $smoke_user_kinitcmd="${kinit_path_local} -kt ${smoke_user_keytab} ${smoke_test_user}; " + $smoke_user_kinitcmd="${hdp::params::kinit_path_local} -kt ${smoke_user_keytab} ${smoke_test_user}; " } else { $smoke_user_kinitcmd="" } http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6928cf3b/ambari-agent/src/main/puppet/modules/hdp-sqoop/manifests/sqoop/service_check.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-sqoop/manifests/sqoop/service_check.pp b/ambari-agent/src/main/puppet/modules/hdp-sqoop/manifests/sqoop/service_check.pp index cf1f6b7..71c9c8f 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-sqoop/manifests/sqoop/service_check.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-sqoop/manifests/sqoop/service_check.pp @@ -27,7 +27,7 @@ class hdp-sqoop::sqoop::service_check() $security_enabled=$hdp::params::security_enabled $smoke_user_keytab = $hdp::params::smokeuser_keytab if ($security_enabled == true) { - $smoke_user_kinitcmd="${kinit_path_local} -kt ${smoke_user_keytab} ${smoke_test_user}; " + $smoke_user_kinitcmd="${hdp::params::kinit_path_local} -kt ${smoke_user_keytab} ${smoke_test_user}; " } else { $smoke_user_kinitcmd="" } http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6928cf3b/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp b/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp index 7433487..da1b036 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/templeton/service_check.pp @@ -28,7 +28,7 @@ class hdp-templeton::templeton::service_check() } else { $security = "false" } - $kinit_path_local = $hdp::params::kinit_path_local + $kinit_path = $hdp::params::kinit_path_local $smoke_user_keytab = $hdp::params::smokeuser_keytab $templeton_host = $hdp::params::webhcat_server_host @@ -51,7 +51,7 @@ define hdp-templeton::smoke_shell_file() } exec { '/tmp/templetonSmoke.sh': - command => "sh /tmp/templetonSmoke.sh ${templeton_host} ${smoke_test_user} ${smoke_user_keytab} ${security} ${kinit_path_local}", + command => "sh /tmp/templetonSmoke.sh ${templeton_host} ${smoke_test_user} ${smoke_user_keytab} ${security} ${kinit_path}", tries => 3, try_sleep => 5, require => File['/tmp/templetonSmoke.sh'], http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6928cf3b/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_kinit_path.rb ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_kinit_path.rb b/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_kinit_path.rb new file mode 100644 index 0000000..ee8e6b1 --- /dev/null +++ b/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_kinit_path.rb @@ -0,0 +1,36 @@ +# +# +# 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. +# +# +#given set of paths find the first full path to knit +module Puppet::Parser::Functions + newfunction(:hdp_get_kinit_path, :type => :rvalue) do |args| + kinit_path = "" + if args.length > 0 + args.join(",").split(',').reject{|s| s.strip.length < 1}.each do |s| + path = File.join(s.strip, "kinit") + if File.exist?(path) and File.file?(path) + kinit_path = path + break + end + end + end + kinit_path + end +end \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6928cf3b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp index 81c6090..3f302d3 100644 --- a/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp +++ b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp @@ -52,7 +52,7 @@ class hdp::params() $kerberos_domain = hdp_default("kerberos_domain","EXAMPLE.COM") $smoketest_user_secure_uid = hdp_default("smoketest_user_secure_uid",1012) ## $smoketest_user_secure_uid = 1012 - $kinit_path_local = hdp_default("kinit_path_local","/usr/bin/kinit") + $kinit_path_local = hdp_get_kinit_path(hdp_default("kinit_path_local"), "/usr/bin", "/usr/kerberos/bin", "/usr/sbin") $keytab_path = hdp_default("keytab_path", "/etc/security/keytabs") $use_hostname_in_principal = hdp_default("instance_name", true) $smokeuser_keytab = hdp_default("smokeuser_keytab", "/etc/security/keytabs/smokeuser.headless.keytab")
