Categories: How-ToMac

Fix yosemite rtc alarm wakeup issue

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!

Jules

Jules is the owner and author of ISPIRE.ME. He's a Linux System Engineer, Tech fanatic and an Open Source fan.

View Comments

  • This worked fine. The only problem is my AirPort Express would no longer work.

    So, back to square one...

      • 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 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.

  • 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.

Recent Posts

HTTP/2 SSL Offloading with Hitch and Varnish

HTTP/2 SSL Offloading with Hitch and Varnish Since Chrome browsers showing you insecure warning on…

7 years ago

File changed as we read it GlusterFS issue

File changed as we read it GlusterFS issue Recently i had trouble running Backups of…

7 years ago

Running multiple instances of varnish using systemd

Running multiple instances of varnish using systemd If you have not yet found a complete…

7 years ago

HTTP/2 SSL Offloading with Haproxy and Nginx

HTTP/2 SSL Offloading with Haproxy and Nginx After HTTP/2 becoming more an more prominent regarding SSL…

7 years ago

Get Real IP with Haproxy Tomcat Jira Confluence using x-forwarded-for

Get Real IP with Haproxy Tomcat Jira Confluence using x-forwarded-for Everyone knows the Problem. Get…

7 years ago

Review TDS2 How to backtest using tick data with Metatrader 4

Review TDS2 How to backtest using tick data with Metatrader 4 in this Review TDS2…

8 years ago

This website uses cookies.