[launchd-dev] Disabling of launchd job if program is missing

Jerry Krinock jerry at ieee.org
Tue Jul 6 11:54:25 PDT 2010


On 2010 Jul 06, at 10:57, Damien Sorresso wrote:

> launchd doesn't know that the needed resource won't come online in the future, so it keeps trying. We used to automatically disable jobs if they failed to run a certain number of times. This didn't really help anyone and in fact made life harder if your binary lived on a network volume that didn't get mounted right away.

Thank you for the history, Damien.  Indeed, in some cases, as in the example you mentioned, we wouldn't want launchd to simply forget the job after a few tries.  But even in your example case, say if the user is working "off line" for five hours, they're going to see this message logged in their Console every ten seconds -- that's 5*60*6 = 1800 log messages.

Of course, using a trampoline program and an uninstaller are solutions, and are currently required by developers.  But since we all need to do the same thing, some "LaunchFail" parameters in launchd.plist(5) would be very helpful.  For example, there might be several "backoff" algorithms from which to choose, with parameters to set, and a parameter stating whether and how to notify the user.  Would anyone else like me to file a bug?

Jerry



More information about the launchd-dev mailing list