We have a Kerberos single-sign-on system in our company. This means that I can just type kinit user@DOMAIN in the terminal, and then I can access all IT resources like file servers, internal wiki, svn server etc.

The problem is, I stay logged in for only 10 hours, so I need to run kinit every morning when I wake my computer from sleep, and every time I restart the computer.

Is there a way to run this command automatically when I start the computer, and every ten hours after that?

I did some research and I assume the correct way to do this is to use a launch agent, because the command must be run as the current user (kinit needs the password from the keychain).

I tried using the following launch agent file, but it doesn't work as expected:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

I don't know why this launch agent doesn't work, and I have no clue how to debug it. Any ideas?


/Library/LaunchAgents/ are tied to individual users where as /Library/LaunchDaemons/ are tied to the machine as a whole. After the system is booted and the kernel is running, property list files found in /Library/LaunchDaemons/ are loaded first as these are system-level daemon.

Try to put your plist in /Library/LaunchDaemons/ and see if it works. Because goal is to run kinit at boot up, so should not matter if it is loaded at system-level.

If its not working please reply here with your findings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.