Macs are generally good at honouring power saving controls, but occasionally your Mac will either not sleep automatically or wake for no apparent reason.
If your Mac won’t sleep then open a Terminal window and use this command:
/usr/bin/pmset -g assertions
This should give you output similar to the following:
Assertion status system-wide: PreventUserIdleDisplaySleep 0 CPUBoundAssertion 0 DisableInflow 0 ChargeInhibit 0 PreventSystemSleep 0 PreventUserIdleSystemSleep 0 ExternalMedia 0 DisableLowPowerBatteryWarnings 0 EnableIdleSleep 1 NoRealPowerSources_debug 0 UserIsActive 0 ApplePushServiceTask 0
What you are looking for is the
PreventUserIdleSystemSleep line, which should be set to zero. If it’s not then the process which is prevent the idle sleep should be listed, like in the example below:
Assertion status system-wide: PreventUserIdleDisplaySleep 0 CPUBoundAssertion 0 DisableInflow 0 ChargeInhibit 0 PreventSystemSleep 0 PreventUserIdleSystemSleep 1 ExternalMedia 0 DisableLowPowerBatteryWarnings 0 EnableIdleSleep 1 NoRealPowerSources_debug 0 UserIsActive 0 ApplePushServiceTask 0 Listed by owning process: pid 194: [0x000000c2012c0368] PreventUserIdleSystemSleep named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,2:0'.noidlesleep"
To check which process this is:
ps u -p <pid>
If your Mac is waking unexpectedly, check the system log for what woke your Mac from its slumber:
/usr/bin/syslog | grep -i "Wake reason"
This will return a number syslog entries which give a clue as to the reason for the wake.
Jul 29 08:49:42 mac kernel <Debug>: Wake reason: EC.PowerButton PWRB (User) Jul 29 08:50:10 mac kernel <Debug>: Wake reason: EHC2 Jul 29 08:52:28 mac kernel <Debug>: Wake reason: EHC1 Jul 29 08:54:13 mac kernel <Debug>: Wake reason: ?
In the examples above the wake reasons were:
EC.PowerButton PWRB (User): The power button being pressed
EHC2: Wireless keyboard key press or mouse movement
EHC1: Connecting an iPad using the USB cable
?: Wake-on-Lan magic packet
Some of the wake reason codes you might encounter:
- EHC/OHC/USB: A USB or Firewire input device such as a keyboard or mouse
- LID0: The lid of your MacBook or MacBook Pro being opened
- PWRB: The power button being pressed
- RTC: Real Time Clock scheduled wake event (check for a wake schedule in System Preferences > Energy Saver > Schedule)
If there is nothing obvious in the system log then you can try finding the culprit through a process of elimination. Try each of these settings in turn and see if that makes a difference.
The first setting to check is in the Energy Saver settings in System Preferences.
Check that ‘Wake for network access’ is not checked. This prevents Wake-on-LAN ‘magic’ packets from waking your machine.
Next click on ‘Schedule’ (bottom right) and make sure there isn’t an automatic wake schedule set.
Finally if you use Bluetooth connected peripherals go into System Preferences > Bluetooth > Advanced and uncheck ‘Allow Bluetooth devices to wake this computer’.
Some applications are also known to be incompatible with Mac OS X’s sleep routines.
This is the list of apps I’ve had problems with:
- Dropbox – disable LAN sync in Preferences
- Drobo Dashboard (DDAssist / DDServiced / DDService64d) – uninstall completely
- Google Drive – just quit the app, no need to uninstall
- smcFanControl – uninstall
Good luck and happy Mac napping.