12 Replies Latest reply: Mar 21, 2013 12:53 PM by jpparallel
gumsie Level 4 Level 4 (2,150 points)

This is what I did, (after mucho digging);

 

1. Clone my system first.

2. Run pmset -g assertions, to find out what's preventing the Mac from sleeping.

My list was constant and was really always two things. com.apple.serve and httpd. These had sub-processes being org.calendarserver.calendarserver, com.apple.server.filesharing, com.apple.ppp.pptp, com.apple.ppp.l2tp, com.apple.collabauthd. There were also com.apple.apache.denysystemsleep and com.apple.helpd.sdmbuilding being a sticking point.

 

I found out that helpd will not prevent sleep once it's finished what it's doing, so sometimes you'll be lucky sometimes not.

Apache on the oher hand I manually unload using sudo apachectl stop. This is something I'll have to look at fixing.

 

So I then set about finding these files and the reason it took so long was because I was looking in entirely the wrong place. Most of these are located at /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons.

I then made the obligatory copies and set about altering the plists. Inserted them as necessary, repaired permissions and restarted.

 

Bob is your mothers brother. I have SLEEP!!!



PowerMac G6 Alu Cinema HD, Mac OS X (10.6), Ctrl, Alt, Del.........AAAaarggghhh!
  • Mac Admin1 Level 1 Level 1 (0 points)

    Hi, can you explain in detail what exactly you have done to files inside:

     

    /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons

     

    to have sleep working?

  • gumsie Level 4 Level 4 (2,150 points)

    Things in your Mac may be different of course but if you do have the same things preventing sleep, navigate to those files and open them with a text editor or XCode. (you'll need to have write permissions for the files and parent folder). You'll see an entry for something like, 'Prevent Sleep'. If its value is yes, change it to no. 

  • Mac Admin1 Level 1 Level 1 (0 points)

    Oh, I should have taken a closer look, it's so obvious. Thank you, it works!

  • Mac Admin1 Level 1 Level 1 (0 points)

    The only thing I can't figure is where and what to change so apache does not prevert sleep - as you outlined it too.

     

    As a temporary solution I inserted the   apachectl stop   command into /etc/rc.sleep - this file is being executed by SleepWatcher before sleep. Yes I know, I have to restart apache manually after wake or automate it, but I'm fine with that.

  • gumsie Level 4 Level 4 (2,150 points)

    That command I used earlier, (unless I'm mistaken), permanently prevents Apache from starting unless it's done manually so I'm good to go with that. I've checked a couple of times and it hasn't restarted automatically for me yet.

  • gumsie Level 4 Level 4 (2,150 points)

    Oh, that Apache stop command doesn't seem to persist across reboots. That or something else is restarting the process.

    But it's no biggie. I can just issue it manually with an automator App for speed.

  • jpparallel Level 1 Level 1 (0 points)

    My solution, although I may discover issues further down the road, is navigate to /System/Library/LaunchDaemons/org.apache.httpd.plist and change "OnDemand=NO" to YES. You'll require ownership permissions of the LaunchDaemons folder and the .plist file. I would say REMEMBER TO BACK THEM UP FIRST!!!!!!!!!!! This is the owning file of apachectl process as best as I can tell.

  • jpparallel Level 1 Level 1 (0 points)

    My solution, although I may discover issues further down the road, is navigate to /System/Library/LaunchDaemons/org.apache.httpd.plist and change "OnDemand=NO" to YES. You'll require ownership permissions of the LaunchDaemons folder and the .plist file. I would say REMEMBER TO BACK THEM UP FIRST!!!!!!!!!!! This is the owning file of apachectl process as best as I can tell.

  • jpparallel Level 1 Level 1 (0 points)

    My solution, although I may discover issues further down the road, is navigate to /System/Library/LaunchDaemons/org.apache.httpd.plist and change "OnDemand=NO" to YES. You'll require ownership permissions of the LaunchDaemons folder and the .plist file. I would say REMEMBER TO BACK THEM UP FIRST!!!!!!!!!!! This is the owning file of apachectl process as best as I can tell.

  • jpparallel Level 1 Level 1 (0 points)

    My solution, although I may discover issues further down the road, is navigate to /System/Library/LaunchDaemons/org.apache.httpd.plist and change "OnDemand=NO" to yes. You'll require ownership permissions of the LaunchDaemons folder and the .plist file. I will say REMEMBER TO BACK THEM UP FIRST!!!!!!!!!!! This is the owning file of apachectl process as best as I can tell.

  • gumsie Level 4 Level 4 (2,150 points)

    Interesting that we'd have to use two different methods on the same software.

  • jpparallel Level 1 Level 1 (0 points)

    Never mind, I can admit when I make a mistake. My "fix" stops the profile manager and device enrolment websites from working. (And possibly more)