Today's Deals (in Amazon.com)

 Question:

lion - MacBook does not sleep when lid is closed
  • alexcoco

    I've looked around for answers and can't find something that works for me.

    I have a unibody aluminum MacBook Pro and it just doesn't seem to want to sleep when I close the lid. The problem started after installing Lion.

    When I close the lid, it appears to go to sleep (i.e. the Apple logo dims) but the status LED stays on and within 5 seconds, the Apple logo is back on. Lifting the screen very slightly reveals that the screen is on at this point.

    I know that it's not sleeping and waking when I close the lid because syslog | grep -i "wake reason" does not show a wake entry for the time the laptop wakes up.

    So far, I've tried PRAM reset, SMC reset, disabling all sharing and bluetooth options. It does sleep with the lid shut when booted in Safe Mode though. This leads me to believe that it's some kind of software or setting that's preventing sleep but I know no way of figuring this out.

    Is there any way to fix this or find out what software is preventing sleep?

  •  Answers:

  • Graham Miln

    A lack of wake reason entries suggests your Mac is never fully sleeping. The sleep mechanism has started but never completes.

    Use the following Terminal command to view a detailed log showing your Mac's power history:

    pmset -g log
    

    You will see a list of entries in form:

     * Domain: applicationresponse.slowresponse
     - Message: PMConnection AirPort configd plug-in com.apple.powermanagement.applicationresponse.slowresponse 1399 ms
     - Time: 13/03/2012 12:27:53 CET 
     - Signature: AirPort configd plug-in
     - UUID: AB482838-2D6E-0000-0000-14BF53E20000
     - Result: Noop
     - Response time (ms): 1399
    

    Look out for applications that may be keeping your Mac awake and active. Applications and other processes can keep your Mac awake if they are providing a service, such as file sharing or remote access. However, processes should be forced asleep after 30 seconds on lid close.

    The behaviour you are seeing suggests a kernel extension or IOKit problem. User level processes can not block sleep when instigated by the user.

    Do you have any utilities installed that install kernel extensions (kext)? These might include screen recording or audio capture tools; utilities than need low level access to your Mac.

  • Ash

    It's worth repairing your permissions, if you haven't already done that. Permissions errors have caused a wide range of bizarre problems in the Lion upgrade.

    It also might help to generate ideas if you can determine if the problem is system-wide or user-specific. Do that by creating a new, pristine user account and using that to see if the problem persists.

    A genuine "clean install" of Lion is still a debated procedure, but some people who exhaust all other diagnostic possibilities have ended up going that route with good success. I hope your problem is more straightforward than that!

    --

    EDIT:

    I gather that booting in Safe Mode solves the problem, but creating a new user doesn't. That strongly suggests the problem is something you're loading at startup. Good news is that this should be straightforward to fix.

    Your experiments so far suggest that whatever is causing the problem is in your /Library directory, and not in your User folder. A manageably small list of things is disabled during a Safe Mode startup, including /System/Library/Extensions, /Library/StartupItems, and notably, any fonts outside of /System/Library/Fonts. Your problem must be something in one of these locations.

    I have a funny feeling that you may have a corrupted font, since this is a common problem that manifests in odd ways. You could try the troubleshooting strategies described here, which essentially consist of validating the fonts using the Font Book utility (included with Mac OS X), clearing out the font cache, and removing any duplicates.

    If fonts aren't the problem, this earlier discussion has good information about how to go about disabling errant startup extensions and login items. It's a matter of taking everything suspicious out, and adding things back bit-by-bit until you find your culprit.

    I think you're close to the solution, please do let us know when you've cracked it.

  • OrangeBox

    Have you tried this fix from the Apple forum. The uses fixed the issue by uninstalling a printer driver which he found out to be causing the issue.

    You might also try disabling the "Wake for Network Access" option

  • SkinnyBill

    I had this problem for a very long time.

    You need to go to:  > System Preferences > Sharing

    you need to TURN OFF Web sharing and Internet Sharing.

    If these don't work, try turning off other sharing options.

  • Kanchan

    Here's a way I've managed to rectify the wakeup/sleep issue with my MBP (early 09)

    It never restarted when I reopened my lid.

    Only occurred when waking up from sleep initiated by lid close.

    Workaround I used was to switch off Automatically adjust brightness (Systems Preferences -> Displays). Hasn't re-occurred since – try that and see how you go.