Fix yosemite rtc alarm wakeup issue
Fix yosemite rtc alarm wakeup issue
After installing new Apple Mac OS X 10.10 Yosemite i ran into an issue were my Macbook Pro wokeup every few hours with lid closed which was very irritating me. After every periodical wakeup my Macbook Pro showing me messages like “Wake reason: RTC (Alarm)” in my syslog. In this snippet i tell you howto Fix yosemite rtc alarm wakeup issue.
First of all, we backup the original file to be safe if something going wrong or for the case we wanna revert the changes later. Open your terminal app and copy following:
To check what causes the wake up of your Mac you can use following handy command in your terminal:
syslog |grep -i "Wake reason"
So if the wakeup reason is something like “Wake reason: RTC (Alarm)” it might be the bonjour multicast feature which prevents your Mac to stay chill in sleep mode.
Backup:
sudo [ -f ~/Downloads/com.apple.discoveryd.plist ] && echo "File already there. Not overwriting it" || cp -a /System/Library/LaunchDaemons/com.apple.discoveryd.plist ~/Downloads/
To disable and prevent the wake reason, we need to edit the plist file with your prefered editor like:
sudo vi /System/Library/LaunchDaemons/com.apple.discoveryd.plist
Next move down to the key “ProgramArguments” and append this string to it:
<string>--no-multicast</string>
so it finally looks like this:
<key>ProgramArguments</key> <array> <string>/usr/libexec/discoveryd</string> <string>--udsocket</string> <string>standard</string> <string>--loglevel</string> <string>Basic</string> <string>--logclass</string> <string>Everything</string> <string>--logto</string> <string>asl</string> <string>--no-multicast</string> </array>
Be sure to have no typos or misleading characters e.g. inserted into plist file or your Mac won’t boot anymore. So better make a backup of that file before changing it.
To make sure that the plist changes are correct you can check the file syntax by entering following command:
plutil /System/Library/LaunchDaemons/com.apple.discoveryd.plist
If everything looks fine. Reboot your system, so it loads the new plist file. Now you have to re-enable Wifi and connect to your Accesspoint. After that change you will realize that the Wifi signal icon won’t show its signal strenght anymore but Wifi is still connected and seem to work fine. So a waking up Mac was a bader option for me than this wakeup fix.
One more note: Printer and NAS/NFS/Samba/AFP Shares e.g. will still reachable by it’s IP/Hostname.
So you can add it again by its IP adress/netpath without auto discovery service.
If something still went wrong or to Restore the changes to original ones you have to enter this command which copies the backup file back to its origin location which we saved by Backup task before:
sudo cp -a ~/Downloads/com.apple.discoveryd.plist /System/Library/LaunchDaemons/
Update:
I found another way to automate this task by using the MacOS internal command PlistBuddy.
So all you have to do now is executing following command in your terminal app:
sudo /usr/libexec/PlistBuddy -c "Add :ProgramArguments: string --no-multicast" /System/Library/LaunchDaemons/com.apple.discoveryd.plist
and reboot the system or run following:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
To revert the last change if something went wrong enter this command:
sudo /usr/libexec/PlistBuddy -c Revert /System/Library/LaunchDaemons/com.apple.discoveryd.plist
12/22/2014: Update — Testers wanted!
Please try my new suggestion to solve this issue and report!
I was playing around with the same issue one more time and disabled the date/time automatic sync and timezone detection on my Macbook.
Date & Time > Disable/Uncheck: Set date and time automatically
Time Zone > Disable/Uncheck: Set time zone automatically using current location
And guess what?
My Macbook did not woke up yet. Finally looks like it having the same effect than disabling Multicast but without all the flaws that came with the previous workaround.
So finally it should look like this:
and this (select your suitable Timezone if field is empty!):
Leave me a comment which solution works for you please!
Extra Bonus: I have encountered one more switch in new discoveryd.
Wondering: Why computer name changing constantly?
Here is the fix: https://ispire.me/computer-name-changing-constantly-yosemite/
Thats all folks!
This worked fine. The only problem is my AirPort Express would no longer work.
So, back to square one…
True. All services that relying on multicast advertising might not work anymore.
This change help my computer sleep but I also had to revert the changes since unfortunately a few really nice features rely on multicast including AirPlay, Wireless sync for iPhones/iPads and AppleTV to computer communications. If you don’t care about these then you are ok but would not consider this a true fix.
Thank you for the solution. Hope it works.
By the way: How can i backup the file as you mentioned in your text?
Greetings from Germany.
Joerg
Hi Joerg,
if you wanna be safe, use one of the commands i described in my blog post.
Depends on which modify method you used.
After applying the command, my Mac sleeps well…
But it can’t find my WLAN printer anymore. 🙁
I tried to revert the command using this line:
PlistBuddy -c Revert /System/Library/LaunchDaemons/com.apple.discoveryd.plist
Terminal says: “Command not found”
So, how can I restore the original file?
Hi Frank,
It’s because the auto discovery service is dependent on multicast which we disabled by that task.
But: Printer and also NAS/NFS/Samba/AFP Shares should still reachable by it’s IP. So you can add it again by its IP adress/Path.
I also updated the correct commands in my Blog post.
Thanks Jules!
After this patch sdmb/cifs shares didn’t work anymore. Reverted to the multicast.
Thanks so much for posting! This bug made it into the released version (does Apple do ANY QA at all I sometimes wonder?) and it’s a temporary fix at least.
Can you tell us, how in the heck did you make the connection from a RTC wakeup alarm to the multicast setting?
That’s worked fine with me, thanks! Only my wi-fi is not working anymore. I deleted the service in Network prefpane and activated again, but still, wi-fi is not working and stays on “searching…” with no timeout 🙁
Hi Raffaele,
bad to hear that this doesn’t work for you. What is your setup? Is it a real Mac/Macbook?
On my Macbook Pro 2008 it just worked fine and had just this Wifi display strength symptom i wrote.
Don’t do this, for now.
--no-multicast
disables Bonjour services and currently breaks Wi-Fi in two ways: prevents auto-reconnection to remembered networks and it also breaks the status icon. (SystemUIServer and friends would need to be fixed.)I don’t have this behavior, exept the UI icon/Wifi signal strenght not getting displayed correctly.
Since it’s just an UI displaying and not an connection/reconnection issue on my Macbook it doesn’t really interfere me.
Any solution for connection/reconnection issue?
Thanks! That helped me fix my hostname changing randomly after upgrading to 10.10
Disabling multicast will likely cause many more problems for users. Apple really needs to patch this.
If this is a bug in OS X Yosemite, why isn’t it universally present?
My new iMac Retina wakes from sleep exactly every 60 minutes.
My Mac Mini that was upgraded to Yosemite will sleep for days without waking.
If this is a bug, why doesn’t it happen to all Macs running Yosemite?
It is not a good solution.
Timemachine won’t work anymore (to a TimeMachine Server), also share desktop does not work automatically if you select a server in Finder.
Amazingly, the first bug fix Yosemite release (10.10.1) does not address this. I had submitted a bug report, which got some traction (“Engineering requests that you …”). In the chain I gave them a link to this page and verified the fix, and recently they closed the bug as duplicate which seemed to indicate to me that it was fixed. Nope!
One gotcha, the plist did change from 10.10 to 10.10.1, but when I updated my fix was still preserved. I’m not sure what happened there as I backed it out first, or thought I did. Anyhow I pulled a clean copy of the plist file from another computer I updated to 10.10.1 and used it, but the computer still woke up after a few hours.
This is truly frustrating.
Seems like your .plist file got cached with obsolete content.
To purge the cache of the file try running:
And reboot your system or restart the service.
Thanks Jules,
Hmm, I tried that and it just spit out most of the file without the XML tags, and didn’t change the file at all. Reading the man page it looks like that command will just read it. There’s also a write command but that’s if I have plist to write or a key/value pair. Thoughts?
Strange. i tought it will wipe the caching also. Maybe with sudo in front?
Can you try following command which will load an unload the .plist file:
OK tried that, it still contains my last change (–no-multicast) which I put back after the 10.01 update. That is it doesn’t seem to change anything.
Hello Jules,
Thanks for posting this, I got mine Yosemite Mackintosh to sleep overnight without rebooting with the AC power connected. Yes, I have to turn on the wifi, reconnect the SSID manually, but it works fine. Yes, I have to add the Wireless printer by using the IP address and it works perfectly.
It’s a trade off, but I think it’s fine this way. At night after working on my laptop, I just want to close the lid, let it sleeps and in the morning, wake up and everything is there. Turn on the wifi and select the connection.
I did the unload the recoveryd.plist before, the computer still rebooted after 2 hours with the AC power connected. So it didn’t really work with the original recoveryd.plist.
Cheers,
Louis
After applying patch smbcifs mounting stops working.
Connect them manually using IP
I ran the commands and am happy that my Mac Pro running 10.10.1 sleeps without waking. However as others have noted I can no longer add a printer connected via USB to my Airport Extreme base station, let alone configure the base station via Airport Utility. Bonjour woes?
I do however have wifi signal strength visible in the Menu bar…
Any suggestions would be greatly appreciated.
~ Ethan
Thank you Jules,
that’s worked fine , fixed wakeup issue,
but I found that the UI icon/Wifi signal strenght not getting displayed issue was indeed exist.
However,Wifi could not connect hotspot automatic ,
I have to choose my own hotspot manual everytime ,
and how to resolve this problem?
Your reply will be highly appreciated.
I don’t have any checkboxes in a ‘timezone’ tab. Also i can’t do not select anything. Other words – i must select something below
No checkboxes in timezone?
If you can select timezone manually, then automaticly is unchecked. Just select a suitable timezone you are in.
It’s been working since “–no multicast”, no problems –
1. Has to connect to wifi manually after waking up.
2. Change printer to manual IP to connect automatically.
3. Never had date-time-location problem.
4. Yosemite 10.10.
ok, i’ve selecred manually
kernel[0] : Wake reason: GLAN XHC EHC1
Okay, you have a totally different Wake Reason that comes from your LAN Device then, that has nothing to do with the Wake Reason RTC Alarm i’m writing about here.
Is this a Mac u are on?
In your case you could do following: Go to your Energy saver options and disable wake for network!
pardon, that was waking from a keyboard pressing. So thats the log from an all day
Dec 23 17:27:32 QWERTY1 kernel[0] : Wake reason: GLAN XHC EHC1
Dec 23 23:56:05 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 23 23:57:03 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 03:33:59 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 05:22:56 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 07:11:53 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 09:00:50 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 10:49:47 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 12:38:44 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 14:27:41 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 16:16:38 QWERTY1 kernel[0] : Wake reason: RTC (Alarm)
Dec 24 17:22:41 QWERTY1 kernel[0] : Wake reason: PWRB (User)
Not working for me, it’s waking every 2 hours as previous.
Found this solution after searching awhile. I have a one month old MacBook air that was losing more charge than it should while in sleep. I tried the time settings you posted and let my MBA sleep overnight. This morning I was at 97% and the terminal log no longer shows RTC (Alarm) every 2 hours or so. I’ll keep you posted going forward.
the last tip (uncheck time/date) didn’t work for me : still those annoying RTC alarm every 2 hours…
would have been really cool if it worked.
I called Apple Care 2 months ago, we ran lots of tests, and they told me the engineers are checking this out.
to be followed…
Hi Remy,
okay thats very weird. It just works perfect on my Macbook Pro 2008 Late with 10.10.2
Have you unchecked automatic timezone also?
sure, it doesn’t work on my computer (imac, mid-2011), even with the two options unchecked.
There must be another trigger somewhere, another setting … when correctly set with time/date, the imac won’t wake, but for now, nothing has changed.
cheers
Hi again,
The 2 checkboxes have been unchecked, and that XXXX RTC alarm is still comin’ back 🙁
maybe the computer needs to be restarted ?
Hi,
unchecking date/time did the trick for me. No more waking ups.
Ludo
Hi Ludo,
nice to hear from the success.
What release of Yosemite you running actually?
10.10.1 or 10.10.2 like me?
Remy,
It doesn’t work for me either. There’s more going on, and my amazement that Apple still hasn’t fixed this continues.
Unchecking date/time did NOT do the trick for me. After unchecking and rebooting, my MacBook, Late 2008 still wakes up (on a TimeMachine based network with an Apple TV connected). Wake on network access is also unchecked.
I also tried to uncheck time/date on my macbook air, and it keeps on waking every 2 hours when plugged with AC. (not when on battery).
Disabling automatic time setting does not worked for me. (auto timezone wasn’t an option)
Hi,
the second solution (Date & Time) works very well for me.
Thanks!
Marc
Restting the SMC might also help fixing the RTC wake problem according to: http://www.macissues.com/2014/04/16/determine-the-reason-why-your-mac-wakes-up/
Am giving it a try and see what happens.
Resetting the SMC doesn’t work in my case. Also disabling NTP doesn’t change, my MBA still wakes every few hours. Any ideas?
Then disabling multicast like i described above might be your only solution.
According to discussion on Apple’s forums, 10.10.2 beta update seems to resolve the issue for some people. I’ll wait and see.
UPDATE 10.10.2 : no more RTC wake up !
Better late than never 🙂
thanx to everyone that tried to help,
till next time
Ditto for me, at least for the first 24h after installing the 10.10.2 update my computer has not been waking up spontaneously!
Yes fixed my several macs that had the problem. It’s clear now what the deal was, the fix didn’t make it in time for the 10.10.1 update, so got bundled into the 10.10.2. Unfortunate for those of us dealing with the issue, it is true that Apple software quality is at an all time low, but at least this did get fixed.
Wow, all I had to do was disable the time auto-sync and time zone detection, and it stopped the wake-ups that were occurring every couple hours. Thanks, you’ve solved what Apple couldn’t fix in 10.10.2!
Finally, this recent update fixed this! Been ongoing since October, waking me up during the night. Absolutely ridiculous, I can’t believe they didn’t do anything about it sooner.
This worked for me on Yosemite.
However, after the upgrade to pre-release El Capitan, I have the problem again.
I can’t proceed according to this tutorial since there seems to be _no_ discoveryd (no /System/Library/LaunchDaemons/com.apple.discoveryd.plist) on El Capitan.
Does anyone have an idea?
Ok, I solved the problem on my El Capitan. I can’t tell what it was exactly, but I did these 3 things:
– https://sysadminblogger.wordpress.com/tag/rtc-alarm/ (system settings and com.apple.mDNSResponder.plist)
– http://apple.stackexchange.com/a/200729 (com.apple.mDNSResponder.plist)
Hello,
Like Jakob, RTC wakeup come back every two hours with El Capitan.
Wait for an Update.
Thank you.
Learning a ton from these neat arstilec.