Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: Turn off automatic wake-from-sleep network check Network
Snow Leopard only hintOne of Snow Leopard's advertised new features is the much more ambitious 'wake for network access' functionality. What was previously a setting only used by geeks and network administrators -- people who readily knew what a 'magic packet' was and how to send one -- has now been expanded and simplified to make it into a feature any user could understand and make use of. A lot of work went into making it just work in any environment.

Unfortunately for those of us who were already happy with the wake on Ethernet access feature as it was in Leopard and before, they fixed what, in our case, didn't need fixing. In Snow Leopard, if you enable waking for network access, your Mac will periodically wake up every two hours (possibly sooner), no matter what. Mind you, it's a special new 'lightweight wake' with the display staying off, and it'll go right back to sleep in about 20 seconds. Still, I absolutely hated the periodic hard drive and fan noise, the apparent pointlessness and wastefulness of it all.

A comment in mDNSResponder's open source code offers some explanation:
we still want to wake up in at most 120 minutes, to see if the network environment has changed. E.g. we might wake up and find no wireless network because the base station got rebooted just at that moment, and if that happens we don't want to just give up and go back to sleep and never try again.
In my case, the network environment is static and only I could change it. I don't use wireless wake, Back to My Mac, or AirPort Extreme's sleep proxy. So how do I turn off this auto-wake feature then?

The code in mDNSResponder makes only two checks on when not to schedule the maintenance wakes:
  • If 'Wake for network access' is turned off
  • if there are no Bonjour-advertised services on your system
This check is always made at the point the machine is about to go to sleep. After much experimentation, I finally have a reliable way of defeating this check without really doing either of the above.

Using sleepwatcher, add the following commands to your script to run when your computer is going to sleep:
/bin/sleep 1
/usr/sbin/systemsetup -setwakeonnetworkaccess on >/dev/null
And add this to your 'wakeup' script:
/usr/sbin/systemsetup -setwakeonnetworkaccess off >/dev/null
Finally, also execute that last command right now, or just manually turn 'Wake for network access' off in the Energy Saver preferences.

What this does is turn wake for network access on only at the very last moment when your machine is going to sleep. This way, mDNSResponder will be fooled into thinking you don't have network wakes enabled, so it won't schedule the unwanted maintenance wake. In reality, though, your sleep script will enable it anyway, but in such a way that mDNSResponder doesn't see it.
    •    
  • Currently 3.57 / 5
  You rated: 3 / 5 (23 votes cast)
 
[22,948 views]  

10.6: Turn off automatic wake-from-sleep network check | 6 comments | Create New Account
Click here to return to the '10.6: Turn off automatic wake-from-sleep network check' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Turn off automatic wake-from-sleep network check
Authored by: blue_fish on Apr 08, '10 09:51:26AM

Hi,

erstmal danke für den Tipp, das aufwachen nervt wirklich!!

Noch ne Frage zur Umsetzung:
Sleepwatcher hab ich runtergeladen und in usr/local/sbin und ../share/man.. kopiert wie in readme beschrieben.

Da ich mich mit Unix leider nicht wirklich auskenne nun die Frage, wie genau füge ich das Skript hinzu, so dass es dann auch automatisch getriggert wird?

Gruß und Danke



[ Reply to This | # ]
10.6: Turn off automatic wake-from-sleep network check
Authored by: blue_fish on Apr 08, '10 10:44:58AM

hi,

hatte schonmal was gepostet, aber wird noch nicht angezeigt.
SleepWatcher ist installiert und Dateien nach Usr/local/share.. kopiert wie beschrieben.

Nun kommt der Teil den ich nicht ganz blicke, wie erstelle ich nun das Skript so dass es vom Trigger ausgelöst wird und was muss ich mit launchd machen?
Kein Plan was ich nun machen muss.

Ne kleine Anleitung wär super ;)



[ Reply to This | # ]
10.6: Turn off automatic wake-from-sleep network check
Authored by: grizzleur on Aug 16, '10 10:24:20AM

Fantastic! You are the man! That is what I've been looking for since the introduction of the "feature" wake-on-demand!

@ blue fish: Genau die Readme von sleepwatcher lesen und auch die .plist nach LaunchAgents kopieren! Die Scripts erstellst Du ganz einfach mit 'nem Texteditor und machst sie mit "chmod +x dein.script" ausführbar! Hope that helps!



[ Reply to This | # ]
10.6: Turn off automatic wake-from-sleep network check
Authored by: hamouras on Jun 13, '11 08:07:44AM
As of version 10.6.5 the mDNSResponder supports a new command line option (DisableSleepProxyClient) which disables the automatic wake-for-network-access feature.

To enable this option edit the file

/System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
so that the ProgramArguments entry includes the option, like this:

	<key>ProgramArguments</key>
	<array>
		<string>/usr/sbin/mDNSResponder</string>
		<string>-launchd -DisableSleepProxyClient</string>
	</array>
Relaunch the mDNSResponder daemon and you're done.

[ Reply to This | # ]
10.6: Turn off automatic wake-from-sleep network check
Authored by: pecosbill on Apr 20, '12 01:42:26PM

Haven't retested this, but -DisableSleepProxyClient killed my startup on 10.6.8 :-( Was really hoping it was the solution as it's cleaner than the original post.

---
Pecos Bill



[ Reply to This | # ]
10.6: Turn off automatic wake-from-sleep network check
Authored by: everkleer80 on Jun 14, '11 08:24:49AM

I do like the new feature that will automatically wake my Mac when I try to access it without requiring me to use a WOL utility. However, I would prefer for my machine not to wake up every two hours, since my home network configuration never (or rarely) changes. It seems that using the solution provided would disable the new feature completely, requiring me to once again use a WOL utility to wake my machine. Is there a way to disable the automatic wakeups without losing SL's 'wake for network access' enhancements?

FYI, the reason I don't really want my machine waking every two hours is because that makes it harder to troubleshoot the issues I often run into where my idle machine wakes itself and doesn't go back to sleep.



[ Reply to This | # ]