[launchd-dev] The "daemons must live for at least 60 seconds" factoid

Jonathan del Strother maillist at steelskies.com
Wed Aug 19 05:16:39 PDT 2009


It's a commonly repeated piece of folklore that if your launchdaemon
completes in under 60 seconds, launchd will assume it has crashed and
will re-launch it.  I have a LaunchAgent with a 2 minute
StartInterval, which exits quickly if there are no available jobs for
it to work on.  launchd tends to run it once due to the StartInterval,
then again 15 seconds later - presumably because it didn't live for at
least 60 seconds.  Adding "sleep(60)" to the end of my LaunchAgent
seems to prevent it from launching the 2nd time around.

 However, I can't find any actual documentation that mentions this,
and I'm sure I've heard somewhere that it was a Tiger bug/feature
only, due to be fixed in Leopard - this appears to not be the case.
It seems an odd feature, too - why relaunch something that exited with
a successful status code?

Is there any official documentation of this behaviour?

-Jonathan del Strother


More information about the launchd-dev mailing list