Skip to content
Snippets Groups Projects
Commit 211db8a9 authored by Eric Mei's avatar Eric Mei
Browse files

update to krb5 script: check krytab for root.

parent 730c27c9
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,20 @@ prepare_krb5_cache() { ...@@ -56,6 +56,20 @@ prepare_krb5_cache() {
return 0 return 0
fi fi
#
# check installed service keytab for root
#
if [ $UID -eq 0 ]; then
output=`$KRB5DIR/bin/klist -5 -k`
if [ $? == 0 ]; then
item=`echo $output | egrep "lustre_mds/.*@"`
if [ "x$item" != "x" ]; then
echo "Using service keytab"
return 0
fi
fi
fi
echo "***** refresh Kerberos V5 TGT for uid $UID *****" echo "***** refresh Kerberos V5 TGT for uid $UID *****"
$KRB5DIR/bin/kinit $KRB5DIR/bin/kinit
ret=$? ret=$?
......
...@@ -9,6 +9,20 @@ if [ $invalid -eq 0 ]; then ...@@ -9,6 +9,20 @@ if [ $invalid -eq 0 ]; then
exit 0 exit 0
fi fi
#
# check installed service keytab for root
#
if [ $UID -eq 0 ]; then
output=`$KRB5DIR/bin/klist -5 -k`
if [ $? == 0 ]; then
item=`echo $output | egrep "lustre_mds/.*@"`
if [ "x$item" != "x" ]; then
echo "Using service keytab"
exit 0
fi
fi
fi
echo "***** refresh Kerberos V5 TGT for uid $UID *****" echo "***** refresh Kerberos V5 TGT for uid $UID *****"
$KRB5DIR/bin/kinit $KRB5DIR/bin/kinit
ret=$? ret=$?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment