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

Dreamcat4 dreamcat4 at gmail.com
Fri Jul 23 00:08:41 PDT 2010


On Thu, Jul 22, 2010 at 11:01 PM, Iceberg-Dev <dev.iceberg at gmail.com> 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?
>
> 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".
>
> - 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? 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)?

For this one id suggest you launch your daemon more frequently. Then
add a start up / initialization check that determines whether the
daemon should run. That way, you can dial it back yourself.

For example if your startcalendarinterval was scheduled to run 1 time
every hour. Then the daemon doesnt have to do anything, it can just
quit until / unless the n*th invokation.

Thats probably a lot easier than messing around with the Apple APIs.

>
> - 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?
>
>
> _______________________________________________
> launchd-dev mailing list
> launchd-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev
>


More information about the launchd-dev mailing list