What exactly is the purpose of TimeOut key in launchd plist? What exactly is the purpose of 'TimeOut' key in launchd plist? I thought a program specified through the first parameter of ProgramArguments will be executed after waiting seconds specified as the value of 'TimeOut'. But this is not happening. I am using Mac OS X version 10.8.2.

The Plist I used is:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
 &lt;key&gt;Label&lt;/key&gt;
 &lt;string&gt;script.test2&lt;/string&gt;
 &lt;key&gt;ProgramArguments&lt;/key&gt;
 &lt;array&gt;
   &lt;string&gt;/bin/sh&lt;/string&gt;
   &lt;string&gt;/var/scripts/test2.sh&lt;/string&gt;
 &lt;/array&gt;
 &lt;key&gt;RunAtLoad&lt;/key&gt;
 &lt;true/&gt;
 &lt;key&gt;StandardOutPath&lt;/key&gt;
 &lt;string&gt;/tmp/test2_script.out&lt;/string&gt;
 &lt;key&gt;StandardErrorPath&lt;/key&gt;
 &lt;string&gt;/tmp/test2_script.err&lt;/string&gt;
 &lt;key&gt;TimeOut&lt;/key&gt;
 &lt;integer&gt;600&lt;/integer&gt;
&lt;/dict&gt;
&lt;/plist&gt;


What I may be doing wrong here?
Launchd just passes the TimeOut value to the job. This is different from ExitTimeOut, which is used by Launchd to send a KILL signal to the job. Your specific requirement should be implemented within your job.

From a post in June 2010 in the Darwin-Kernel mailing list:
Re: What is TimeOut ("idle time out") in launchd?


  This specifies the idle exit timeout. If your daemon hasn't received a request in this amount of time, it should quit. Notably launchd does not implement this for you; it's up for you to implement the timeout in your daemon's main event loop.