Jump to content

Wake reason: RTC (Alarm) - how to deactivate?


VirusX
 Share

215 posts in this topic

Recommended Posts

I was having issues with the Yosemite DPs booted via Clover waking in the middle of the night, often at 6am, and crashing out. I'd wake up to find the machine had rebooted, and could check the console log to gather that it had woken and crashed. I followed this thread as a lurker to keep track on what folks have been doing. I realize most of you just don't want your machines waking every few hours. That part doesn't bother me; it was the crashing out that I was trying to fix.

 

I'm pleased to report that on my rig at least, a GA 7 series board with discrete AMD graphics card, and a fresh install of the latest Clover and Yosemite GM, my machine wakes every few hours but does NOT crash, at least in the 2 days since I built it. That's the behavior I'm looking for so I'm happy. I didn't mess with any of the darkwake settings, so when I say the machine wakes, I am referring to the stuff in the console log. For all I know it's waking "silently" and going back to sleep.

 

If it helps anyone, I followed tonymacx86's clover installation guide at http://www.tonymacx86.com/yosemite-desktop-guides/144426-how-install-os-x-yosemite-using-clover.html, including the part about converting the EFI partition to MBR (something I hadn't known to do previously). 

Link to comment
Share on other sites

I gave credit in the instructions to mcdougal33 and p.H.  Those guys, particularly mcdougal33, solved this issue.  Thanks guys.

:D You get me kind of embarrassed somehow. Hats off to mcdougal33. He's the man.:D

I was having issues with the Yosemite DPs booted via Clover waking in the middle of the night, often at 6am, and crashing out. I'd wake up to find the machine had rebooted, and could check the console log to gather that it had woken and crashed. I followed this thread as a lurker to keep track on what folks have been doing. I realize most of you just don't want your machines waking every few hours. That part doesn't bother me; it was the crashing out that I was trying to fix.

 

I'm pleased to report that on my rig at least, a GA 7 series board with discrete AMD graphics card, and a fresh install of the latest Clover and Yosemite GM, my machine wakes every few hours but does NOT crash, at least in the 2 days since I built it. That's the behavior I'm looking for so I'm happy. I didn't mess with any of the darkwake settings, so when I say the machine wakes, I am referring to the stuff in the console log. For all I know it's waking "silently" and going back to sleep.

 

If it helps anyone, I followed tonymacx86's clover installation guide at http://www.tonymacx86.com/yosemite-desktop-guides/144426-how-install-os-x-yosemite-using-clover.html, including the part about converting the EFI partition to MBR (something I hadn't known to do previously). 

So you mean your hack wakes itself up then after some time goes to sleep automatically?

Link to comment
Share on other sites

:D You get me kind of embarrassed somehow. Hats off to mcdougal33. He's the man. :D

So you mean your hack wakes itself up then after some time goes to sleep automatically?

Keeping in mind that I haven't personally witnessed the behavior because my hack sits upstairs, yes, to the best of my knowledge, the hack is waking itself up every 2 hours or so and then going back to sleep automatically. I think it's doing this because the console log shows that it wakes up by RTC alarm roughly every two hours. Since the machine is always asleep when I check on it, I'm assuming it's just going back to sleep each time. To the best of my knowledge, that is the designed intention on Apple's part. They sort of intend their machines to "silently" wake up, check for stuff like new mail, time machine backups, software updates, etc., and then go back to sleep. The darkwake stuff is sort of an override to that, as far as I know - when you tell it "darkwake 0" my  understanding is "never wake silently, always come fully awake" but it's been a while since I messed with that so I may be way off.

Link to comment
Share on other sites

I've had the same problem on early 2009 Power Mac.  I updated to Yosemite by installing it right over a stable Mavericks OS. 

 

Your instructions are clear.  Thank you for your time and the work you put into this. 

 
Before installing the files in the "kit," I first searched the drive for "mDNSResponder" using EasyFind.  It produced the following result:
 
/private/etc/asl/com.apple.networking.mDNSResponder 
/private/var/run/mDNSResponder
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/share/man/man8/mDNSResponder.8
/usr/share/man/man8/mDNSResponder.8
/System/Library/CoreServices/mDNSResponder.bundle/
/usr/share/sandbox/mDNSResponder.sb
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/share/man/man8/mDNSResponderHelper.8
/usr/share/man/man8/mDNSResponderHelper.8
 
There were no existing preference files in any location.
 
Finding these files scattered in various places on my drive concerned me.  I am reluctant to install your Kit because I don't want to create a conflict.  Or perhaps since none of these has created a preference files, they are always dormant.
 
If you have the time please advise me on what to do.  
1) Delete all of the other instances?
2) Ignore them
3) Not install the Kit.
 
Thanks!
Link to comment
Share on other sites

Cave_Dweller, I personally would go with 2) and try your luck. You won't really destroy something crucial here. You will only disable one DNS service and replace it with an old one. The worst you can expect is no internet connection.

This solution here can also easily be undone/uninstalled again by unloading the 2 mDNS services, removing those 4 files and loading discoveryhd again.

 

Good luck!

Link to comment
Share on other sites

This is an interesting read and I grabbed the mDNSResponder.zip for future consideration, still a little reluctant about the process. Anyway it was a nice effort, thanks for your work. Found this support article about mDNSRespnder - http://support.apple.com/kb/HT3789?viewlocale=de_DE - so Apple isn't completely inconsiderate about Bonjour issues, now they just need to add options like this to discoveryd, also for both ways, advertising and receiving Bonjour announcements and we might be set.

Also some setting in-between might be nice, I do like seeing Bonjour services, but I am fine with restricting that to my Mac being actually turned on, d'oh!

Link to comment
Share on other sites

Oops. So real Mac would also have this issue? When mac wakes up, will the display be lit?

Yes they do. I don't know if thats a problem with old Macs or new ones also. I always hear my slot in drive turning on which makes me wake up at night.

Since i don't want to destroy the possibility for future Yosemite upgrades by copying unverified binaries and plist files which will replace the new discoveryd service and probably bring new unknown bugs, i choose the other fix mentioned which just disables multicast in discoveryd plist. Since i don't use auto discovery features im fine with it and haven't seen any cons yet. My nas shares working like before. Mounted by IP

 

This is an interesting read and I grabbed the mDNSResponder.zip for future consideration, still a little reluctant about the process. Anyway it was a nice effort, thanks for your work. Found this support article about mDNSRespnder - http://support.apple.com/kb/HT3789?viewlocale=de_DE - so Apple isn't completely inconsiderate about Bonjour issues, now they just need to add options like this to discoveryd, also for both ways, advertising and receiving Bonjour announcements and we might be set.

Also some setting in-between might be nice, I do like seeing Bonjour services, but I am fine with restricting that to my Mac being actually turned on, d'oh!

The way of doing this: http://support.apple.com/kb/HT3789?viewlocale=de_DE with new discoveryd is described in this blog article: http://ispire.me/fix-yosemite-rtc-alarm-wakeup-issue/

Link to comment
Share on other sites

Keeping in mind that I haven't personally witnessed the behavior because my hack sits upstairs, yes, to the best of my knowledge, the hack is waking itself up every 2 hours or so and then going back to sleep automatically. I think it's doing this because the console log shows that it wakes up by RTC alarm roughly every two hours. Since the machine is always asleep when I check on it, I'm assuming it's just going back to sleep each time. To the best of my knowledge, that is the designed intention on Apple's part. They sort of intend their machines to "silently" wake up, check for stuff like new mail, time machine backups, software updates, etc., and then go back to sleep. The darkwake stuff is sort of an override to that, as far as I know - when you tell it "darkwake 0" my  understanding is "never wake silently, always come fully awake" but it's been a while since I messed with that so I may be way off.

Oops. But in my opinion, if that's what Apple really wants to do, wake up should not light the screen. Isn't it?

Link to comment
Share on other sites

Oops. But in my opinion, if that's what Apple really wants to do, wake up should not light the screen. Isn't it?

My understanding is that the normal process is that the screen does not light. Certainly on real Macs I don't think the screen lights. Hacks of course have different c-states etc (stuff managed by the SDST file) that indicate how deeply to sleep, how lightly to wake, in addition to the darkwake setting. This can also muck with "wake for network access". Earlier I was trying to get my hack to wake via network "magic packet" and I could hear the drive wake up but the screen wouldn't light. So I changed darkwake to 0, and solved that issue; the screen fully lit. 

 

It all depends on what you want to accomplish. My understanding is that real Macs wake without lighting the screen periodically by design, and wake for network access fully. Hacks are an entirely different beast and it can take some fiddling to get the behavior you want, including not waking every two hours as this thread is primarily geared towards.

Link to comment
Share on other sites

My understanding is that the normal process is that the screen does not light. Certainly on real Macs I don't think the screen lights. Hacks of course have different c-states etc (stuff managed by the SDST file) that indicate how deeply to sleep, how lightly to wake, in addition to the darkwake setting. This can also muck with "wake for network access". Earlier I was trying to get my hack to wake via network "magic packet" and I could hear the drive wake up but the screen wouldn't light. So I changed darkwake to 0, and solved that issue; the screen fully lit. 

 

It all depends on what you want to accomplish. My understanding is that real Macs wake without lighting the screen periodically by design, and wake for network access fully. Hacks are an entirely different beast and it can take some fiddling to get the behavior you want, including not waking every two hours as this thread is primarily geared towards.

:D I think Real Macs users could implement this method to avoid two-hours wake up as well if they really wants to mess with it. :D Anyway, I suppose your MB is BIOS only. I once thought DarkWake was related to UEFI only. Am I wrong about that?

Link to comment
Share on other sites

 

 

The way of doing this: http://support.apple.com/kb/HT3789?viewlocale=de_DE with new discoveryd is described in this blog article: http://ispire.me/fix-yosemite-rtc-alarm-wakeup-issue/

 

Thanks, I've seen that, but losing the signal strength icon is sort of a downer for me... Maybe I'll just leave it waking up, although I'm not even sure if my router works as a Bonjour sleep proxy at all...

Link to comment
Share on other sites

:D I think Real Macs users could implement this method to avoid two-hours wake up as well if they really wants to mess with it. :D Anyway, I suppose your MB is BIOS only. I once thought DarkWake was related to UEFI only. Am I wrong about that?

This is a GA Z77-series mobo, so it's BIOS/UEFI, currently booting clover/UEFI. I think darkwake is mobo-agnostic; I know I changed it with my older BIOS mobo. My recollection is that somewhere around snow leopard or lion, Apple completely revamped how sleep/wake worked. Prior to that, wake was wake - screen lit, system on. Apple wanted to support a "silent wake" to support periodic silent time machine backups and system updates - the machine would wake up enough to do that stuff but not light the screen. That's when I needed to set darkwake, so that the magic packet wouldn't use the "silent wake" style of waking, but rather, the full screen lit wake that I wanted.

Link to comment
Share on other sites

Perhaps switching to 'safe sleep' could resolve the problem.

 

     hibernatemode = 0 (binary 0000) by default on supported desktops. The system will not back memory up to persistent storage. The system must wake

     from the contents of memory; the system will lose context on power loss. This is, historically, plain old sleep.

 

     hibernatemode = 3 (binary 0011) by default on supported portables. The system will store a copy of memory to persistent storage (the disk), and will

     power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from hibernate image.

 

     hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will

     remove power to memory. The system will restore from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life,

     you should use this setting.

 

To get the current hibernate mode, issue via Terminal:

pmset -g

Using hibernatemode no. 25, the computer is switched off, so it should not wake up every 2 hours. Hibernatemode 25 is activated via

sudo pmset -a hibernatemode 0

Unfortunately I can not test this, because my system freezes at wake up, when using mode 25. It freezes right after Clover - display stays black, system dead, have to press power button to reboot the machine. After that system reboots regular.

 

Update: Got hibernation working with this fix. But it didnt solve the the Wake reason: RTC (Alarm) issue. System wakes up every 0.5-2h in a crashed state.

Link to comment
Share on other sites

Perhaps switching to 'safe sleep' could resolve the problem.

 

 

To get the current hibernate mode, issue via Terminal:

pmset -g

Using hibernatemode no. 25, the computer is switched off, so it should not wake up every 2 hours. Hibernatemode 25 is activated via

sudo pmset -a hibernatemode 0

Unfortunately I can not test this, because my system freezes at wake up, when using mode 25. It freezes right after Clover - display stays black, system dead, have to press power button to reboot the machine. After that system reboots regular.

:D It's great to see people are taking efforts to sort this puzzle out. Just so you know, I set hibernatemode to 0 as soon as I finished installing the OS. So I don't think setting 0 will take effect.

Link to comment
Share on other sites

Using hibernatemode no. 25, the computer is switched off, so it should not wake up every 2 hours. Hibernatemode 25 is activated via

sudo pmset -a hibernatemode 0

 

 

:D It's great to see people are taking efforts to sort this puzzle out. Just so you know, I set hibernatemode to 0 as soon as I finished installing the OS. So I don't think setting 0 will take effect.

 

Sorry - my fault, typo. I wanted to suggest to set it to '25'. So the command ist:

sudo pmset -a hibernatemode 25
Link to comment
Share on other sites

 

Sorry - my fault, typo. I wanted to suggest to set it to '25'. So the command ist:

sudo pmset -a hibernatemode 25

I don't like sleepImage taking up my disk space. So I will not switch to that mode. :D

Hope somebody else would do this test. After all, mDNS method is just fine.

Link to comment
Share on other sites

Since changing these files over has anyone ben able to get 'auto sleep' to work fine?

 

Mine keeps going to screensaver...


Since changing these files over has anyone ben able to get 'auto sleep' to work fine?

 

Mine keeps going to screensaver...

Link to comment
Share on other sites

Since changing these files over has anyone ben able to get 'auto sleep' to work fine?

 

Mine keeps going to screensaver...

Since changing these files over has anyone ben able to get 'auto sleep' to work fine?

 

Mine keeps going to screensaver...

Mine works fine for auto sleep.

Link to comment
Share on other sites

Another approach which might be more future proof is to just unload discoveryd when the machine is about to go to sleep and then load it again at wakeup. Sleepwatcher can be used to run scripts at sleep and wakeup events. My /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>de.bernhard-baehr.sleepwatcher</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/sbin/sleepwatcher</string>
		<string>-V</string>
		<string>-s /etc/rc.sleep</string>
		<string>-w /etc/rc.wakeup</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>KeepAlive</key>
	<true/>
</dict>
</plist>

/etc/rc.sleep:


#!/bin/sh
# Unload discoveryd to disable maintenance wakeup every two hours
launchctl unload /System/Library/LaunchDaemons/com.apple.discoveryd.plist

 
/etc/rc.wakeup:

#!/bin/sh
# Load discoveryd to enable network
launchctl load /System/Library/LaunchDaemons/com.apple.discoveryd.plist

EDIT: Changed to working configuration

  • Like 5
Link to comment
Share on other sites

Another approach which might be more future proof is to just unload discoveryd when the machine is about to go to sleep and then load it again at wakeup. Sleepwatcher can be used to run scripts at sleep and wakeup events. My /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>de.bernhard-baehr.sleepwatcher</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/sbin/sleepwatcher</string>
		<string>-V</string>
		<string>-s 'launchctl unload /System/Library/LaunchDaemons/com.apple.discoveryd.plist'</string>
		<string>-w 'launchctl load /System/Library/LaunchDaemons/com.apple.discoveryd.plist'</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>KeepAlive</key>
	<true/>
</dict>
</plist>

I haven't tested it overnight yet but it seems to be working. I'll let you know if it isn't.

This looks like a good idea.  The only thing I would try differently is to use launchctl stop and start instead of load and unload. 

 

EDIT: never mind.  stop and start don't appear to work as they should.  Load and unload work fine.

Link to comment
Share on other sites

 Share

×
×
  • Create New...