[launchd-dev] Questions on mixed triggers and calendar triggers

Damien Sorresso dsorresso at apple.com
Fri Jul 23 00:27:21 PDT 2010


On Jul 22, 2010, at 3:01 PM, Iceberg-Dev wrote:
> I've read some WWDC sessions slides, the launchd.plist man page and I've already made some launchd plists but I'm wondering about the following points:
> 
> - is it possible to define different types of trigger for a launchd daemon or agents?

Yes. launchd ORs criteria together. So if it can find an excuse to kick your job off, it will.

> For instance, is it possible to launch a daemon both on schedule with StartCalendarInterval and a mach message? The idea being the process would be run at a specific time of the day but could also be launched "manually".

Yes. Though why would you want your daemon to run on a timer interval if you can just launch it on-demand whenever you need to?

> - is there a way to change the StartCalendarInterval values of a daemon launchd plist (while the launchd daemon is running) with some kind of launchd APIs instead of Foundation/CoreFoundation APIs?

The property list format is defined at the CoreFoundation layer. So no.

> If you change these values, do you need to unload and then reload the plist (I would tend to believe so which would be an issue)?

Why do you need to change this value?

> - is it possible tell launchd to re-launch a schedule daemon if the daemon crashes and not only when the next trigger date is reached?


See the KeepAlive section of launchd.plist(5), specifically, SuccessfulExit.
-- 
Damien Sorresso
BSD Engineering
Apple Inc.



More information about the launchd-dev mailing list