I need to have a server asleep most of the time, only waking up to serve the occasional web page/WebDav/FTP request (will use knockd + WOL to wake server).
Right now the server will not sleep automatically when idle.
==Set-up / Config
I have a "standard configuration" OS X Server v10.5.8 running on an Intel Mac Mini Core Duo 1.66GHz 2Gb RAM.
This is a clean install - I have not yet loaded any 3rd party applications, drivers, etc.
I have reset the NVRAM, PRAM, and SMC.
I have no services running (no webservices, no AFP, etc. etc., i.e no green lights in Server Preferences. I also clicked off all the check boxes for all the services in Server Admin -> Services) (Earlier I had noticed in the logs that the AFP service seemed to be waking the machine up periodically - so I turned of AFP and all the other services just to eliminate this potential - obviously eventually I want the WebServices and FTP to keep the machine awake if they are responding to requests)
I do have wake on LAN enabled - which based on my requirements is mandatory.
I can choose sleep from the Apple menu and the computer sleeps and stays asleep OK and wakes without problem.
The display will turn off as per the settings in Energy Saver system preference.
But the computer will not sleep based on the settings in Energy Saver.
There are no relevent errors in the logs I can see (can post if useful).
Using pmset in terminal:
public-24devon:~ admin$ pmset -g
AC Power -1*
Currently in use:
==What I've tried
1. I tried to setting ttyskeepawake to 0 using sudo, and while pmset -g showed the new value the computer wouldn't sleep.
2. Oddly, after turning on the screen saver, and manually invoking it (via a hot corner), and then coming out of screen saver (move off hot corner), the mac mini will sleep automatically - but only twice and *WITHIN* the time set in Energy Preferences - i.e. if energy preferences is set to sleep after 2 mins the mac mini will sleep in < 2 mins. After waking up the mini will sleep one more time within 2 mins. It wil lthen not sleep again until after reinvoking the screen saver.
While I managed to have this behaviour happen 2 or 3 times it isn't reproducable 100% of the time.
3. I have tried removing all the USB peripherals - keyboard and mouse, and I have also tried removing the screen (leaving only power and ethernet).
4. Tried booting with the originally installed (non-server) version of the OS 10.5.7 - and it will also not sleep - which suggests its not something to do with the OS per-se perhaps - althought I had to boot from an external USB.
5. The following applescript will sleep the machine when run as an application:
tell application "System Events" to sleep
If we can't figure out how to get the Energy Preferences sleep functionality to work then using an applescript could work - as long as inside the script I can figure out how to determine if apache or the FTP server is currently responding to a request.
Thoughts or ideas on what I should try next?