MacTexan Wallpaper o' th' Week

Sedona Starry Night


Help us, WE'RE BROKE:
Search MacTexan
MacTexan on Twitter

« Swap the Hard Drive in a 2009 27" iMac with a SSD | Main | Find Out Who's Connected to Your iTunes Library »
Tuesday
Aug212012

Why Won't My Mac Go To Sleep?

For some reason I've always had trouble getting my 27" iMac to sleep when it was supposed to. I spent a lot of time searching forums and trying a dozen or so different things offered up by users and Apple alike. A few times I found something that seemed to work, only to find my Mac awake again in the middle of the night. It turns out there are literally hundreds of things capable of rendering your Mac a total insomniac. Everything from Bluetooth connections to wonky external hard drives can be the culprit. The process of elimination can take forever. How do you shorten the list without trying everything one at a time? Well, thanks to a post at Macworld, I learned once again that the command line would come to my rescue. This simple command:
pmset -g assertions
will result in a list of processes "asserting" themselves on OS X. Something like this...
 

...showing the number of processes doing things to your system. The two concerning system sleep prevention are PreventSystemSleep and PreventUserIdleSystemSleep. If either of these have a process count greater than zero then you need to look further. The command results go on to list (in order) specific processes assocoated with non-zero values in the above list...

As you can see, the AppleFileServer process was the culprit in my case. Obviously, some other machine on my network was connected to a share on my iMac, preventing it from snoozing. If your case is not so obvious, you can lookup the pid in Activity Monitor (in this example, pid 666) to see if you can gleen more information. Activity Monitor lets you sort active processes by pid, making things easy to find and even easier to quit. 

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>