Parcourir la source

AMBARI-2081. changeUid.sh failing during installation. New fixes. (swagle)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1479725 13f79535-47bb-0310-9956-ffa450edef68
Siddharth Wagle il y a 12 ans
Parent
commit
c1385cd039

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

@@ -21,7 +21,7 @@
 
 username=$1
 newUid=$2
-dirs=$3
+directories=$3
 
 function find_available_uid() {
  for ((i=1001; i<=2000; i++))
@@ -35,7 +35,7 @@ function find_available_uid() {
  done
 }
 
-grep -q $i /etc/passwd
+grep -q $newUid /etc/passwd
 if [ "$?" != 0 ]
 then
   echo "Uid $newUid is available for $username"
@@ -50,7 +50,7 @@ then
   exit 1
 fi
 
-dir_array=($(echo $dirs | sed 's/,/\n/g'))
+dir_array=($(echo $directories | sed 's/,/\n/g'))
 old_uid=$(id -u $username)
 echo "Changing uid of $username from $old_uid to $newUid"
 echo "Changing directory permisions for ${dir_array[@]}"

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

@@ -158,7 +158,7 @@ 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/${smoke_user},/home/${smoke_user},/var/spool/mail/${smoke_user}"
+  $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}"
   $cmd_set_uid_check = "test $(id -u ${smoke_user}) -gt 1000"