Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrViking

macrumors member
Original poster
Jul 16, 2011
54
8
Hello,

My iMac does not go to sleep automatically. Not when i'm running Lion nor when running Windows 7. Only if i select "sleep" it does, automatically it does not anymore.

I disabled all sharing stuff, WOL etc. Reset the SMC and PRAM.

I now formatted and then reinstalled from the recovery partition.

Still it doesn't go to sleep. The display dims but i still hear the machine's HDD + fans.

Can anyone help me as where to find a culprit or reason for this behaviour?

27" 2011 iMac

Thank you
 
Last edited:

Set845

macrumors regular
Jun 29, 2010
115
7
I had the same problem with my mid 2011 27 inch i7 imac. To find out what is preventing sleep open Console and search Wake Reason in the kernel log. If you find a Wake Reason event that returns a code you can google it to find the meaning of the code. You can also check to see if there is anything in your Launch Agent folder in both system and user libraries. Also check your startup items in your Users Preference pane.
 

MrViking

macrumors member
Original poster
Jul 16, 2011
54
8
I had the same problem with my mid 2011 27 inch i7 imac. To find out what is preventing sleep open Console and search Wake Reason in the kernel log. If you find a Wake Reason event that returns a code you can google it to find the meaning of the code. You can also check to see if there is anything in your Launch Agent folder in both system and user libraries. Also check your startup items in your Users Preference pane.

Thanks for the advice. :)

Couldn't find anything in the logs though :<

The problem is, i formatted (no apps left) and the problem was the same under bootcamp.

I am pretty clueless right now.. :(
 

Set845

macrumors regular
Jun 29, 2010
115
7
I'm not in front of my iMac right now so forgive me if I get this wrong. Check your Bluetooth settings. Try turning off wake with Bluetooth. Sorry I can't remember the correct term. If you have a Bluetooth mouse/trackpad then you won't be able to wake or log on the Mac. But this is just a test. Wake the Mac with the power button and don't bother to try logging on. Wait for the monitor to dim, give it a few minutes and then listen for the fans. If it in fact goes to sleep then the problem is Bluetooth. Maybe the keyboard or mouse, or the USB controller that Bluetooth is on. You will need a USB keyboard and mouse to log back on to enable wake on bluetooth again. Sometimes changing a setting like that and changing it back can fix it.

----------

Oops scratch that last part. You won't need a USB keyboard and mouse. You can wake the Mac with the power button. Sorry I'm sitting in a dentist waiting room right now. Not the best place to give advise from.
 

MrViking

macrumors member
Original poster
Jul 16, 2011
54
8
I'm not in front of my iMac right now so forgive me if I get this wrong. Check your Bluetooth settings. Try turning off wake with Bluetooth. Sorry I can't remember the correct term. If you have a Bluetooth mouse/trackpad then you won't be able to wake or log on the Mac. But this is just a test. Wake the Mac with the power button and don't bother to try logging on. Wait for the monitor to dim, give it a few minutes and then listen for the fans. If it in fact goes to sleep then the problem is Bluetooth. Maybe the keyboard or mouse, or the USB controller that Bluetooth is on. You will need a USB keyboard and mouse to log back on to enable wake on bluetooth again. Sometimes changing a setting like that and changing it back can fix it.

----------

Oops scratch that last part. You won't need a USB keyboard and mouse. You can wake the Mac with the power button. Sorry I'm sitting in a dentist waiting room right now. Not the best place to give advise from.

Thank you for the advice. I installed the "pleasesleep"-app and that helped, but it shouldn't be necessary for the machine. So after de-installing that app it worked sometimes. But now it doesn't anymore :/

The screen dims, the HDD rattles (saving something?) and then nothing... I unchecked the bluetooth wake.

Probably have to bring it to an APR.. :(

Hope the dentist didn't hurt you too bad ;)

----------



hmm screen turns off. After a while I hear the hardisk spin down and click, as it is turning off... but then it spins up again and i can clearly hear it's on!
 
Last edited:

Set845

macrumors regular
Jun 29, 2010
115
7
Copy and paste this in Terminal

pmset -g assertions

then hit Enter.

That will tell you if there are any conditions keeping the Mac awake. If PreventSystemSleep and/or PreventUserIdleSystemSleep returns a 1 then the command should display the reason. They should return a 0. EnableIdleSleep should return a 1. Did you check the LaunchAgent folders in both user and system library? I once found a plist file there for a printer driver that was keeping my Mac awake.

Oh and speaking of printers. If you have one, it's possible that a print job could be stuck in the print spooler keeping the Mac awake.
 
Last edited:

NZPilgrim

macrumors newbie
Nov 3, 2011
21
1
New Zealand
I used to have a similar issue as well. Mine was a USB wireless receiver for a second mouse I was using. Whatever the polling period was was just enough to prevent my Mac from going to sleep unless I specifically slept it. And then it would wake the machine up anyway. Pulled the receiver from the Mac, no more issues.

Also, I tried finding the wake reason but nothing was showing up in the activity monitor. Turns out I had to log in with my Admin account for those events to show up. If you're using a standard account you likely won't see much at all.
 

MrViking

macrumors member
Original poster
Jul 16, 2011
54
8
I used to have a similar issue as well. Mine was a USB wireless receiver for a second mouse I was using. Whatever the polling period was was just enough to prevent my Mac from going to sleep unless I specifically slept it. And then it would wake the machine up anyway. Pulled the receiver from the Mac, no more issues.

Also, I tried finding the wake reason but nothing was showing up in the activity monitor. Turns out I had to log in with my Admin account for those events to show up. If you're using a standard account you likely won't see much at all.

Thank you for all the advice, it appears after a reinstall and doing some things with the sharing settings, removing some apps etc. it's fixed :)
 

jota73

macrumors 6502
Apr 19, 2006
303
0
South America
Copy and paste this in Terminal

pmset -g assertions

then hit Enter.

That will tell you if there are any conditions keeping the Mac awake. If PreventSystemSleep and/or PreventUserIdleSystemSleep returns a 1 then the command should display the reason. They should return a 0. EnableIdleSleep should return a 1. Did you check the LaunchAgent folders in both user and system library? I once found a plist file there for a printer driver that was keeping my Mac awake.

Oh and speaking of printers. If you have one, it's possible that a print job could be stuck in the print spooler keeping the Mac awake.

Set845,

I did as you said, and I got the following:

pmset -g assertions
Last login: Sun Jun 24 10:09:20 on console
Juan-Fernando-Vallejos-iMac:~ jota$ pmset -g assertions
26/06/12 6:57:14 GMT-05:
Assertion status system-wide:
PreventUserIdleDisplaySleep 1
CPUBoundAssertion 0
DisableInflow 0
ChargeInhibit 0
PreventSystemSleep 0
PreventUserIdleSystemSleep 0
ExternalMedia 0
DisableLowPowerBatteryWarnings 0
EnableIdleSleep 1
NoRealPowerSources_debug 0
UserIsActive 0
ApplePushServiceTask 0

Listed by owning process:
pid 367: [0x0000016f012c0043] PreventUserIdleDisplaySleep named: "com.apple.WebCore: HTMLMediaElement playback"

I see there might be one issue... coould you tell me what else I must do?

Besides this, I get 5 kernel assertions

thanks
Juan
 

Set845

macrumors regular
Jun 29, 2010
115
7
Set845,

I did as you said, and I got the following:

pmset -g assertions
Last login: Sun Jun 24 10:09:20 on console
Juan-Fernando-Vallejos-iMac:~ jota$ pmset -g assertions
26/06/12 6:57:14 GMT-05:
Assertion status system-wide:
PreventUserIdleDisplaySleep 1
CPUBoundAssertion 0
DisableInflow 0
ChargeInhibit 0
PreventSystemSleep 0
PreventUserIdleSystemSleep 0
ExternalMedia 0
DisableLowPowerBatteryWarnings 0
EnableIdleSleep 1
NoRealPowerSources_debug 0
UserIsActive 0
ApplePushServiceTask 0

Listed by owning process:
pid 367: [0x0000016f012c0043] PreventUserIdleDisplaySleep named: "com.apple.WebCore: HTMLMediaElement playback"

I see there might be one issue... coould you tell me what else I must do?

Besides this, I get 5 kernel assertions

thanks
Juan

It looks like some process is preventing your display from sleeping thereby keeping your Mac awake. Try this to list info about process 367.

ps -ax | grep 367

Then hit Enter.
 

jota73

macrumors 6502
Apr 19, 2006
303
0
South America
It looks like some process is preventing your display from sleeping thereby keeping your Mac awake. Try this to list info about process 367.

ps -ax | grep 367

Then hit Enter.

Here is the result of ps -ax | grep 367

367 ?? 182:03.22 /System/Library/StagedFrameworks/Safari/WebKit2.framework/WebProcess.app/Contents/MacOS/WebProcess /System/Library/StagedFrameworks/Safari/WebKit2.framework/WebKit2 -type webprocess -servicename com.apple.WebKit.WebProcess-365-0x11074f1e0 -localization es_ES
3679 ?? 0:00.62 /Applications/iTunes.app/Contents/MacOS/iTunesHelper.app/Contents/MacOS/iTunesHelper -psn_0_655520
31296 ttys000 0:00.00 grep 367
 

Set845

macrumors regular
Jun 29, 2010
115
7
It does look as if some WebProcess is the culprit. iTunes helper is also listed. Try removing it (and anything else) from your Login Items in Users & Groups System Preference Pane. Did you search for "Wake Reason" in Console kernel log? See post 2. You can also search "sleep".
 

jota73

macrumors 6502
Apr 19, 2006
303
0
South America
It does look as if some WebProcess is the culprit. iTunes helper is also listed. Try removing it (and anything else) from your Login Items in Users & Groups System Preference Pane. Did you search for "Wake Reason" in Console kernel log? See post 2. You can also search "sleep".

Set845

Thanks, could you tell me how to I remove such? I not as agile when doing this.

Thanks
 

Set845

macrumors regular
Jun 29, 2010
115
7
Open System Preferences (in the dock by default). Click on Users & Groups. Click the Login Items button. On the right side window highlight iTunesHelper and press the minus button (on the bottom of the window) to remove it. Highlight and remove any other items that may be listed. You can easily add them back by way of the plus button.
 

imac331731

macrumors newbie
Mar 20, 2013
1
0
Kent, UK
I had the same problem and followed the steps via terminal and mine was down to having internet sharing switched on. My iMac would stay on with the screen off at night and all I could hear was the hard drive and fan going. Now pure silence.

Thank you for the useful and easy to follow instructions.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.