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.
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:
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:
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/
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!