ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject [1/3] git commit: ARGUS-11 Agent Installation script fails to create credential store
Date Wed, 20 Aug 2014 01:23:59 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master 67f8a000d -> 72054a366


ARGUS-11 Agent Installation script fails to create credential store

Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/0166486f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/0166486f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/0166486f

Branch: refs/heads/master
Commit: 0166486f36b56a8e8e34fc8161330b69999632b1
Parents: 086831e
Author: rmani <rmani@hortonworks.com>
Authored: Tue Aug 19 13:58:20 2014 -0700
Committer: rmani <rmani@hortonworks.com>
Committed: Tue Aug 19 13:58:20 2014 -0700

----------------------------------------------------------------------
 hbase-agent/scripts/install.properties |  2 +-
 hbase-agent/scripts/install.sh         | 30 +++++++++++++++++++++++------
 hdfs-agent/scripts/install.properties  |  2 +-
 hdfs-agent/scripts/install.sh          | 25 ++++++++++++++++++++----
 hive-agent/scripts/install.properties  |  2 +-
 hive-agent/scripts/install.sh          | 25 ++++++++++++++++++++----
 6 files changed, 69 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/0166486f/hbase-agent/scripts/install.properties
----------------------------------------------------------------------
diff --git a/hbase-agent/scripts/install.properties b/hbase-agent/scripts/install.properties
index 064e2f4..42cc0ee 100644
--- a/hbase-agent/scripts/install.properties
+++ b/hbase-agent/scripts/install.properties
@@ -42,7 +42,7 @@ XAAUDIT.DB.PASSWORD=
 #
 # Credential Provider File Path
 #
-# CREDENTIAL_PROVIDER_FILE=/etc/xasecure/conf/{repoName}-credstore.jceks
+# CREDENTIAL_PROVIDER_FILE=/etc/xasecure/{repoName}-credstore.jceks
 #
 
 CREDENTIAL_PROVIDER_FILE=

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/0166486f/hbase-agent/scripts/install.sh
----------------------------------------------------------------------
diff --git a/hbase-agent/scripts/install.sh b/hbase-agent/scripts/install.sh
index 5d1a371..cc34922 100644
--- a/hbase-agent/scripts/install.sh
+++ b/hbase-agent/scripts/install.sh
@@ -8,14 +8,14 @@ alias=$1
 pass=$2
 jceksFile=$3
 
-ret=`hadoop credential create ${alias} --value ${pass} --provider jceks://file${jceksFile}
2>&1`
+ret=`hadoop credential create ${alias} -value ${pass} -provider jceks://file${jceksFile}
2>&1`
 res=`echo $ret | grep 'already exist'`
 
 if ! [ "${res}" == "" ]
 then
    echo "Credential file already exists,recreating the file..."
-   hadoop credential delete ${alias} --provider jceks://file${jceksFile}
-   hadoop credential create ${alias} --value ${pass} --provider jceks://file${jceksFile}
+   hadoop credential delete ${alias} -provider jceks://file${jceksFile}
+   hadoop credential create ${alias} -value ${pass} -provider jceks://file${jceksFile}
 fi
 }
 
@@ -160,20 +160,38 @@ then
 				mv ${hbase_lib_dir}/${fn} ${hbase_lib_dir}/.${fn}.${cdt}
 			fi
 			echo "+cp ${f} ${hbase_lib_dir}/${fn}"
-			cp ${f} ${hbase_lib_dir}/${fn}
+			cp ${f} ${hbase_lib_dir}/${fn}	
 		fi
 	done
 fi
 
 
 CredFile=`grep '^CREDENTIAL_PROVIDER_FILE' ${install_dir}/install.properties | awk -F= '{
print $2 }'`
-
+		
 if ! [ `echo ${CredFile} | grep '^/.*'` ]
 then
-  echo "Please enter the Credential File Store with proper file path"
+  echo "ERROR:Please enter the Credential File Store with proper file path"
   exit 1
 fi
 
+dirno=`echo ${CredFile}| awk -F"/" '{ print NF}'`
+
+if [ ${dirno} -gt 2 ];
+then
+ pardir=`echo ${CredFile} |  awk -F'/[^/]*$' '{ print $1 }'`
+ if [ ! -d  ${pardir} ];
+ then
+   mkdir -p ${pardir}
+   if [ $? -eq 0 ];
+   then
+     chmod go+rx ${pardir}
+   else
+     echo "ERROR: Unable to create credential store file path"
+   fi
+ fi
+fi
+
+
 #
 # Generate Credential Provider file and Credential for Audit DB access.
 #

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/0166486f/hdfs-agent/scripts/install.properties
----------------------------------------------------------------------
diff --git a/hdfs-agent/scripts/install.properties b/hdfs-agent/scripts/install.properties
index e851391..b622abe 100644
--- a/hdfs-agent/scripts/install.properties
+++ b/hdfs-agent/scripts/install.properties
@@ -44,7 +44,7 @@ XAAUDIT.DB.PASSWORD=
 #
 # Credential Provider File Path
 #
-# CREDENTIAL_PROVIDER_FILE=/etc/xasecure/conf/{repoName}-credstore.jceks
+# CREDENTIAL_PROVIDER_FILE=/etc/xasecure/{repoName}-credstore.jceks
 #
 
 CREDENTIAL_PROVIDER_FILE=

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/0166486f/hdfs-agent/scripts/install.sh
----------------------------------------------------------------------
diff --git a/hdfs-agent/scripts/install.sh b/hdfs-agent/scripts/install.sh
index 59c248f..e8649c5 100644
--- a/hdfs-agent/scripts/install.sh
+++ b/hdfs-agent/scripts/install.sh
@@ -7,14 +7,14 @@ alias=$1
 pass=$2
 jceksFile=$3
 
-ret=`hadoop credential create ${alias} --value ${pass} --provider jceks://file${jceksFile}
2>&1`
+ret=`hadoop credential create ${alias} -value ${pass} -provider jceks://file${jceksFile}
2>&1`
 res=`echo $ret | grep 'already exist'`
 
 if ! [ "${res}" == "" ]
 then
    echo "Credential file already exists,recreating the file..."
-   hadoop credential delete ${alias} --provider jceks://file${jceksFile}
-   hadoop credential create ${alias} --value ${pass} --provider jceks://file${jceksFile}
+   hadoop credential delete ${alias} -provider jceks://file${jceksFile}
+   hadoop credential create ${alias} -value ${pass} -provider jceks://file${jceksFile}
 fi
 }
 
@@ -178,10 +178,27 @@ CredFile=`grep '^CREDENTIAL_PROVIDER_FILE' ${install_dir}/install.properties
| a
 
 if ! [ `echo ${CredFile} | grep '^/.*'` ]
 then
-  echo "Please enter the Credential File Store with proper file path"
+  echo "ERROR:Please enter the Credential File Store with proper file path"
   exit 1
 fi
 
+dirno=`echo ${CredFile}| awk -F"/" '{ print NF}'`
+
+if [ ${dirno} -gt 2 ];
+then
+ pardir=`echo ${CredFile} |  awk -F'/[^/]*$' '{ print $1 }'`
+ if [ ! -d  ${pardir} ];
+ then
+   mkdir -p ${pardir}
+   if [ $? -eq 0 ];
+   then
+     chmod go+rx ${pardir}
+   else
+     echo "ERROR: Unable to create credential store file path"
+   fi
+ fi
+fi
+
 #
 # Generate Credential Provider file and Credential for Audit DB access.
 #

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/0166486f/hive-agent/scripts/install.properties
----------------------------------------------------------------------
diff --git a/hive-agent/scripts/install.properties b/hive-agent/scripts/install.properties
index 9ce44be..6d26ec3 100644
--- a/hive-agent/scripts/install.properties
+++ b/hive-agent/scripts/install.properties
@@ -49,7 +49,7 @@ POLICY_CACHE_FILE_PATH=
 #
 # Credential Provider File Path
 #
-# CREDENTIAL_PROVIDER_FILE=/etc/xasecure/conf/{repoName}-credstore.jceks
+# CREDENTIAL_PROVIDER_FILE=/etc/xasecure/{repoName}-credstore.jceks
 #
 
 CREDENTIAL_PROVIDER_FILE=

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/0166486f/hive-agent/scripts/install.sh
----------------------------------------------------------------------
diff --git a/hive-agent/scripts/install.sh b/hive-agent/scripts/install.sh
index 51e49a0..7f59e37 100644
--- a/hive-agent/scripts/install.sh
+++ b/hive-agent/scripts/install.sh
@@ -7,14 +7,14 @@ alias=$1
 pass=$2
 jceksFile=$3
 
-ret=`hadoop credential create ${alias} --value ${pass} --provider jceks://file${jceksFile}
2>&1`
+ret=`hadoop credential create ${alias} -value ${pass} -provider jceks://file${jceksFile}
2>&1`
 res=`echo $ret | grep 'already exist'`
 
 if ! [ "${res}" == "" ]
 then
    echo "Credential file already exists,recreating the file..."
-   hadoop credential delete ${alias} --provider jceks://file${jceksFile}
-   hadoop credential create ${alias} --value ${pass} --provider jceks://file${jceksFile}
+   hadoop credential delete ${alias} -provider jceks://file${jceksFile}
+   hadoop credential create ${alias} -value ${pass} -provider jceks://file${jceksFile}
 fi
 }
 
@@ -146,10 +146,27 @@ CredFile=`grep '^CREDENTIAL_PROVIDER_FILE' ${install_dir}/install.properties
| a
 
 if ! [ `echo ${CredFile} | grep '^/.*'` ]
 then
-  echo "Please enter the Credential File Store with proper file path"
+  echo "ERROR:Please enter the Credential File Store with proper file path"
   exit 1
 fi
 
+dirno=`echo ${CredFile}| awk -F"/" '{ print NF}'`
+
+if [ ${dirno} -gt 2 ];
+then
+ pardir=`echo ${CredFile} |  awk -F'/[^/]*$' '{ print $1 }'`
+ if [ ! -d  ${pardir} ];
+ then
+   mkdir -p ${pardir}
+   if [ $? -eq 0 ];
+   then
+     chmod go+rx ${pardir}
+   else
+     echo "ERROR: Unable to create credential store file path"
+   fi
+ fi
+fi
+
 #
 # Generate Credential Provider file and Credential for Audit DB access.
 #


Mime
View raw message