4 # KDC could be on remote hosts, but we suppose lgssd/lsvcgssd only
8 export KDCHOST=${KDCHOST:-"localhost"}
9 export KDCDIR=${KDCDIR:-"/usr/kerberos/sbin"}
10 export KRB5DIR=${KRB5DIR:-"/usr/kerberos"}
11 export LGSSD=${LGSSD:-"/usr/sbin/lgssd"}
12 export SVCGSSD=${SVCGSSD:-"/usr/sbin/lsvcgssd"}
13 export PDSH=${PDSH:-"ssh"}
15 export CHECK_KDC=${CHECKKDC:-"no"}
18 if [ "x$1" != "xkrb5i" -a "x$1" != "xkrb5p" ]; then
26 if [ `using_krb5_sec $SECURITY` == 'n' ] ; then
30 if [ "x$CHECK_KDC" == "xno" ]; then
34 num=`$PDSH $KDCHOST "PATH=\$PATH:$KDCDIR; ps ax | grep krb5kdc | grep -v "grep" | wc -l"`
35 if [ $num -eq 1 ]; then
39 $PDSH $KDCHOST "PATH=\$PATH:$KDCDIR; krb5kdc"
40 num=`$PDSH $KDCHOST "PATH=\$PATH:$KDCDIR; ps ax | grep krb5kdc | grep -v "grep" | wc -l"`
41 if [ $num -ne 1 ]; then
42 echo "fail to start krb5 KDC, check env KDCHOST and KDCDIR"
48 prepare_krb5_cache() {
49 if [ `using_krb5_sec $SECURITY` == 'n' ] ; then
53 $KRB5DIR/bin/klist -5 -s
55 if [ $invalid -eq 0 ]; then
59 echo "***** refresh Kerberos V5 TGT for uid $UID *****"
66 if [ `using_krb5_sec $SECURITY` == 'n' ] ; then
70 killall -q -9 lsvcgssd || true
73 num=`ps -o cmd -C "lsvcgssd" | grep lsvcgssd | wc -l`
74 if [ $num -ne 1 ]; then
75 echo "failed to start lsvcgssd"
82 killall -q -9 lsvcgssd || true
87 if [ `using_krb5_sec $SECURITY` == 'n' ] ; then
91 prepare_krb5_cache || exit 1
93 killall -q -9 lgssd || true
96 num=`ps -o cmd -C "lgssd" | grep lgssd | wc -l`
97 if [ $num -ne 1 ]; then
98 echo "failed to start lgssd $num"
105 killall -q -9 lgssd || true