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

Iceberg-Dev dev.iceberg at gmail.com
Fri Jul 23 16:06:20 PDT 2010


On Jul 23, 2010, at 9:27 AM, Damien Sorresso wrote:

> On Jul 22, 2010, at 3:01 PM, Iceberg-Dev wrote:
>> 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?
>
>> 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?

Let's imagine you have a solution to check for updates. Let's call it  
Software Update.

You may want to check for updates on a regular basis and you may want  
the user to check for update whenever (s)he wants.

You may also want to do some load balancing for your server update.  
So it might be nice if not every single user would check for updates  
at the same time when the check is performed on schedule.

So for instance, you may want to:

- schedule the first check during the installation by dynamically  
setting the next calendar date.

- perform checks every xx hours. When a check is performed, you want  
the next check to occur xx hours after the current one.

- when a manual check has been performed. Run the next scheduled  
check xx hours after the manual check.




More information about the launchd-dev mailing list