[launchd-dev] What is "Service only ran for XX seconds … Pushing respawn out …"

Jerry Krinock jerry at ieee.org
Sun Nov 16 02:39:14 PST 2014


My app installs a launchd job which watches a file and runs a tool whenever that file changes.  The tool typically runs for a few seconds and then terminates itself.  This has worked OK for years.  Yesterday, however, I noticed that launchd sometimes complains to the system log that my “Service” (??) ran for some number of seconds which is less than 60, and so it is “Pushing respawn out” by the difference in seconds between this duration that it supposedly “ran” and 60.  Example:

14/11/16 3:31:54.822 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 25 seconds. Pushing respawn out by 35 seconds.

Does anyone have any idea what might be going on?  60 seconds happens to be the ThrottleInterval of the job, not the expected “run” time.  Am I running a “Service”?  (I don’t think so.)  Why might launchd think it needs to be “respawned”?

I’m on OS X 10.10.1 (14B17).  A sanitized version of my job’s plist, and a filtered console log, are below.  

I can’t find any of these strings in the latest launchd source, which might be at this link:
    http://www.opensource.apple.com/source/launchd/launchd-842.92.1/src/
But I’m *really* groping in the dark whenever I visit there.

Thank you,

Jerry Krinock 


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>MyLabel</string>
	<key>Nice</key>
	<integer>20</integer>
	<key>ProgramArguments</key>
	<array>
		<string>/path/to/MyTool</string>
		<string>MyArg1</string>
		<string>MyArg2</string>
	</array>
	<key>ThrottleInterval</key>
	<integer>60</integer>
	<key>WatchPaths</key>
	<array>
		<string>/path/to/MyFile</string>
	</array>
</dict>
</plist>


14/11/16 3:22:29.948 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 57 seconds. Pushing respawn out by 3 seconds.
14/11/16 3:25:05.659 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 59 seconds. Pushing respawn out by 1 seconds.
14/11/16 3:26:00.903 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 54 seconds. Pushing respawn out by 6 seconds.
14/11/16 3:30:29.608 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 0 seconds. Pushing respawn out by 60 seconds.
14/11/16 3:31:54.822 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 25 seconds. Pushing respawn out by 35 seconds.
14/11/16 3:33:20.050 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 50 seconds. Pushing respawn out by 10 seconds.
14/11/16 3:34:28.347 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 58 seconds. Pushing respawn out by 2 seconds.
14/11/16 3:48:24.681 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 0 seconds. Pushing respawn out by 60 seconds.
14/11/16 3:49:59.418 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 34 seconds. Pushing respawn out by 26 seconds.
14/11/16 3:51:22.418 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 56 seconds. Pushing respawn out by 4 seconds.
14/11/16 3:52:43.228 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 1 seconds. Pushing respawn out by 59 seconds.
14/11/16 3:54:14.707 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 32 seconds. Pushing respawn out by 28 seconds.
14/11/16 3:56:06.659 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 0 seconds. Pushing respawn out by 60 seconds.
14/11/16 3:57:07.151 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 0 seconds. Pushing respawn out by 60 seconds.
14/11/16 3:58:32.343 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 25 seconds. Pushing respawn out by 35 seconds.
14/11/16 4:00:43.205 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 0 seconds. Pushing respawn out by 60 seconds.
14/11/16 4:04:30.194 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 0 seconds. Pushing respawn out by 60 seconds.
14/11/16 4:06:03.763 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 33 seconds. Pushing respawn out by 27 seconds.
14/11/16 4:07:08.939 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 38 seconds. Pushing respawn out by 22 seconds.
14/11/16 4:08:09.133 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 38 seconds. Pushing respawn out by 22 seconds.
14/11/16 4:10:03.729 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 1 seconds. Pushing respawn out by 59 seconds.
14/11/16 4:11:37.160 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 34 seconds. Pushing respawn out by 26 seconds.
14/11/16 4:12:54.515 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 51 seconds. Pushing respawn out by 9 seconds.
14/11/16 4:14:50.649 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 0 seconds. Pushing respawn out by 60 seconds.
14/11/16 4:16:54.758 AM com.apple.xpc.launchd[1]: (MyLabel) Service only ran for 0 seconds. Pushing respawn out by 60 seconds.



More information about the launchd-dev mailing list