Long-running jobs
If a job is to run longer
than the maximum ticket life, the tickets/tokens must be
renewed. One way to do this is to run an authentication loop
along-side your long-running job. Two scripts are needed: one
to serve as the parent process (longjob) and one to run the
authentication loop (authloop). First, longjob: #!/bin/sh
export KRB5CCNAME=/tmp/krb5cc_$$.longjob
kinit -r 8d
aklog
nohup authloop &> /tmp/$1.auth.$$ &
nohup $@ &> /tmp/$1.job.$$ &
Next, authloop: #!/bin/sh
while true; do
sleep 5h
kinit -R
aklog
done
Note that '8d' should be changed to the maximum renewable
lifetime for your domain. To use, put both scripts in your PATH and runlongjob ./mylongrunningprogram
If you're at the lab, you can just use /afs/csail/i386_linux24/local/bin/longjob.