Просмотр исходного кода

AMBARI-2101. Hive service check (still) failing with file permissions. (swagle)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1481136 13f79535-47bb-0310-9956-ffa450edef68
Siddharth Wagle 12 лет назад
Родитель
Сommit
5cd97eedeb

+ 3 - 0
CHANGES.txt

@@ -837,6 +837,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2101. Hive service check (still) failing with file permissions.
+ (swagle)
+
  AMBARI-2095. It's possible to get into a state where install retry is not
  possible if the agent stops heartbeating. (jaimin via yusaku)
 

+ 3 - 3
ambari-agent/src/main/puppet/modules/hdp/files/changeToSecureUid.sh

@@ -27,7 +27,7 @@ function find_available_uid() {
  for ((i=1001; i<=2000; i++))
  do
    grep -q $i /etc/passwd
-   if [ "$?" != 0 ]
+   if [ "$?" -ne 0 ]
    then
     newUid=$i
     break
@@ -36,7 +36,7 @@ function find_available_uid() {
 }
 
 grep -q $newUid /etc/passwd
-if [ "$?" != 0 ]
+if [ "$?" -ne 0 ]
 then
   echo "Uid $newUid is available for $username"
 else
@@ -44,7 +44,7 @@ else
   find_available_uid
 fi
 
-if [ $newUid == 0 ]
+if [ $newUid -eq 0 ]
 then
   echo "Failed to find Uid between 1000 and 2000"
   exit 1

+ 2 - 2
ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp

@@ -153,8 +153,8 @@ class hdp::create_smoke_user()
   ## Set smoke user uid to > 1000 for enable security feature
   $secure_uid = $hdp::params::smoketest_user_secure_uid
   $changeUid_path = "/tmp/changeUid.sh"
-  $smoke_user_dirs = "/tmp/hadoop-${smoke_user},/tmp/hsperfdata_${smoke_user},/home/${smoke_user}"
-  $cmd_set_uid = "$changeUid_path ${smoke_user} ${secure_uid} ${smoke_user_dirs}"
+  $smoke_user_dirs = "/tmp/hadoop-${smoke_user},/tmp/hsperfdata_${smoke_user},/home/${smoke_user},/tmp/${smoke_user},/tmp/sqoop-${smoke_user}"
+  $cmd_set_uid = "$changeUid_path ${smoke_user} ${secure_uid} ${smoke_user_dirs} 2>/dev/null"
   $cmd_set_uid_check = "test $(id -u ${smoke_user}) -gt 1000"
 
   file { $changeUid_path :