Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Authen::Krb5 Problem

by gw1500se (Beadle)
on Nov 04, 2008 at 12:25 UTC ( #721367=perlquestion: print w/ replies, xml ) Need Help??
gw1500se has asked for the wisdom of the Perl Monks concerning the following question:

I am having a bizzare (to me) problem with Authen::Krb5. Specifically, Authen::Krb5::get_in_tkt_with_password fails but only when the script is run in background (i.e. no console). When run from the command line it works. To make matters worse $! is null. Does anyone have any ideas on why this fails only with no console and how to fix it? TIA.

Comment on Authen::Krb5 Problem
Re: Authen::Krb5 Problem
by Anonymous Monk on Nov 04, 2008 at 12:50 UTC
    What does Authen::Krb5::error() return?
Re: Authen::Krb5 Problem
by converter (Priest) on Nov 04, 2008 at 14:56 UTC
    When you write
    ...fails only when the script is run in background
    I wonder if you mean "when run from cron." If so, you should be aware that most cron implementations start processes in a limited environment. My first guess would be that kerberos is missing information that it normally fetches from an environment variable and this is causing it to fail. Perhaps the cache is in a non-standard location? In any event, as previous poster suggested, the output of the error method would be useful in determining the cause of your failure.
Re: Authen::Krb5 Problem
by gw1500se (Beadle) on Nov 04, 2008 at 15:00 UTC
    Thanks for the reply. This is one of those DOH! things. I completely forgot about error(). Fixing that I found that the problem is really with the credentials cache.
    $cc=Authen::Krb5::cc_default(); $cc->initialize($clientp);
    The initialize call fails with this error:

    Credentials cache I/O operation failed XXX

    Not very helpful to me but hopefully you can understand it. To me the puzzle is why does an attached console make any difference?
      Not very helpful to me but hopefully you can understand it. To me the puzzle is why does an attached console make any difference?

      No, but the oracle might.

      Credentials cache I/O operation failed XXX

      Cause:

      Kerberos had a problem writing to the system's credentials cache (/tmp/krb5cc_uid).

      Solution:

      Make sure that the credentials cache has not been removed, and that there is space left on the device by using the df command.

      Might be permissions Credentials cache I/O operation failed XXX (with 1.5.x on Windows 2003 Terminal Server)?
        Thanks for the reply but its none of the above. There is plenty of space in that file system. However, lets not lose sight of the original problem. This only fails when it is run without a console (cron or at). Since the script runs in root's crontab I don't see how permissions can be a problem, particularly in /tmp.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://721367]
Approved by rovf
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-12-29 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (185 votes), past polls