MacOS – launchd StartCalendarInterval not working reliably

launchdmacos

I have several tasks that I run from launchd using StartCalendar interval.

Under Yosemite these do not necessarily run. (Under Mavericks and earlier they did run)

How do I see what launchd is doing and thinks should happen, how can I get launchd to log what happens(The tasks themselves write to logs but if they don't run I obviously get nothing)

For example I have this task which is due off at 1212 and 1412 and 2039 and on at 0601. The log gives all at the same time

2014-11-08 15:29:56.082 tdtool_mwb[9383:329594] Turning off device 3, Other
2014-11-08 15:29:56.684 tdtool_mwb[9387:329601] Turning on device 3, Other
2014-11-08 22:32:18.563 tdtool_mwb[14594:523323] Turning off device 3, Other
2014-11-09 18:16:52.844 tdtool_mwb[21630:891263] Turning on device 3, Other
2014-11-09 18:16:52.844 tdtool_mwb[21626:891252] Turning off device 3, Other
2014-11-09 20:42:37.353 tdtool_mwb[23789:973903] Turning off device 3, Other

My machine does turn at 0600 and I was logged in at midday to 2100 on both days.

Note I have other scripts that have the same issue it is not just something with tdtool_mwb (or even if it was how do I debug this)

If I reboot then they run correctly for a day or two.

If the machine is running and not sleeping then also seems OK but if it sleeps then it fails.

Best Answer

It was a bug introduced in 10.10.0 as mentioned here

It seems to have been fixed in 10.10.3