launchd and system sleep
Hello, The manual page for the "StartInterval" key mentions that "if the system is asleep, the job will be started the next time the computer wakes up". However I'm receiving bug reports from users which seem to indicate this is not always the case (the job is not launched for a long period of time). The problem does not seem to occur with the "StartCalendarInterval" key. I've also noticed the "com.apple.backupd-wake.plist" Time Machine job which is apparently triggered at wake time although it advertises no way to be launched. Why the need for this additional job since "com.apple.backupd-auto.plist" uses the "StartInterval" key? Is it a workaround for a launchd issue? Is this a known issue or am I missing something? Can something be done about this? Regards, Thomas
On Jun 1, 2009, at 1:55 PM, Thomas Clement wrote:
Hello,
The manual page for the "StartInterval" key mentions that "if the system is asleep, the job will be started the next time the computer wakes up". However I'm receiving bug reports from users which seem to indicate this is not always the case (the job is not launched for a long period of time). The problem does not seem to occur with the "StartCalendarInterval" key.
There is a bug in the kernel which prevents timers from coalescing after a wake from sleep (rdar://problem/4058640). launchd worked around it for Leopard, but the workaround was only applied to StartCalendarInterval, not StartInterval, apparently.
I've also noticed the "com.apple.backupd-wake.plist" Time Machine job which is apparently triggered at wake time although it advertises no way to be launched. Why the need for this additional job since "com.apple.backupd-auto.plist" uses the "StartInterval" key? Is it a workaround for a launchd issue?
That job is for when you turn on Time Machine backups from System Preferences.
Is this a known issue or am I missing something? Can something be done about this?
If it's feasible for you to switch to StartCalendarInterval, that could be a temporary solution. -- Damien Sorresso BSD Engineering Apple Inc.
On Jun 1, 2009, at 11:17 PM, Damien Sorresso wrote:
On Jun 1, 2009, at 1:55 PM, Thomas Clement wrote:
Hello,
The manual page for the "StartInterval" key mentions that "if the system is asleep, the job will be started the next time the computer wakes up". However I'm receiving bug reports from users which seem to indicate this is not always the case (the job is not launched for a long period of time). The problem does not seem to occur with the "StartCalendarInterval" key.
There is a bug in the kernel which prevents timers from coalescing after a wake from sleep (rdar://problem/4058640). launchd worked around it for Leopard, but the workaround was only applied to StartCalendarInterval, not StartInterval, apparently.
That bug number is low. I hope it will be fixed in 10.6.
I've also noticed the "com.apple.backupd-wake.plist" Time Machine job which is apparently triggered at wake time although it advertises no way to be launched. Why the need for this additional job since "com.apple.backupd-auto.plist" uses the "StartInterval" key? Is it a workaround for a launchd issue?
That job is for when you turn on Time Machine backups from System Preferences.
My understanding is that the "com.apple.backupd-auto.plist" job uses the StartInterval key and the "com.apple.backupd-wake.plist" job was added to work around bug 4058640. Since apparently Time Machine is not affected by the bug, I suspected this "backupd-wake" job was the workaround (else I don't see the point of this job).
Is this a known issue or am I missing something? Can something be done about this?
If it's feasible for you to switch to StartCalendarInterval, that could be a temporary solution.
Thanks for your quick answer! Regards, Thomas
participants (2)
-
Damien Sorresso
-
Thomas Clement