This is rather annoying as it means the disks in the NAS can no longer spin down even when there are no user accessing the box. It has also made redundant all my previous efforts in getting the disks to spin down as often as possible (e.g. moving ffp, mysql db and www pages to a USB stick).
To get back my desired behaviour, I have three options:
- Upgrade to 128MB of physical RAM
- Run Squeezed (a lightweight alternative) instead of SqueezeCenter
- Start/Stop SqueezeCenter on demand
The second option seems like a good idea but it is really basic right now and lacks a lot of SqueezeCenter's features. Perhaps some time in the future I will reconsider this option.
The third option is a good compromise between having the full feature set of SqueezeCenter and getting my power-saving mode back when my SqueezeBox Boom is turned off. The only drawback is that there is a 2-3 minutes wait (for starting the monster up on the DNS-323) before the SqueezeBox Boom gets connected to SqueezeCenter when it is powered on.
I followed the instructions in Yannick's post and managed to get it working on my box with little trouble. I also made a number of changes to make it more robust, configurable and fit the ffp environment better. If you have followed my previous post on getting SqueezeCenter running on the DNS-323, you may find this approach more friendly.
In addition, I created a startup script for the standby daemon so that ffp will start the standby daemon rather than SqueezeCenter on boot/reboot. The assumption here is that I most likely do not need SqueezeCenter when I boot/reboot the box and I rather let a SqueezeBox client trigger the startup of SqueezeCenter than to have it unnecessarily load up my boot process and increase the boot time.
Here's a log of what I did to get this setup working in my environment:
- Set up standby daemon script
- Download and install script (link)
# cd /ffp
# wget -O standby_daemon.tar.gz http://forum.dsmg600.info/attachment.php?item=497
# tar -xzvf standby_daemon.tar.gz
# rm standby_daemon.tar.gz - Configure sudoers to allow user nobody to trigger the script without password. [IMPT: do not blindly copy the code below! replace {your_hostname} with your real hostname!]
# cd /ffp/etc
# chmod u+w sudoers
# echo "nobody {your_hostname}= NOPASSWD: /ffp/sbin/slimserver_standby_daemon.pl" >> sudoers
# chmod u-w sudoers
- Download and install script (link)
- Set up SqueezeCenter plugin - Server Power Control
- Download and install plugin from here
# cd /ffp/lib/squeezecenter/Plugins/
# wget -O SrvrPowerCtrl.zip http://forums.slimdevices.com/attachment.php?attachmentid=7357&d=1241562529
# unzip SrvrPowerCtrl.zip
# rm SrvrPowerCtrl.zip - Restart SqueezeCenter to load the newly installed plugin.
- Go to the settings page of the plugin (Settings>Plugins, look for Server Power Control and click on settings on the right) after SqueezeCenter has restarted
- Check the first two options (Shutdown and Shutdown to SqueezeNetwork) and enter "sudo /ffp/sbin/slimserver_standby_daemon.pl" in the textbox below it (both of them). Leave the rest of the options unchecked as we can't use them on the DNS-323.
- At the end of the settings dialog, select the option Monitor idle Players and select Shutdown server for the field Action to take after idle time. Optionally you can also setup the same in End of day action with a shorter idle time.
- Save the settings and you are done.
- Download and install plugin from here
- [Optional] Start standby daemon instead of SqueezeCenter on boot/reboot
# cd /ffp/start
# chmod a-x slimserver.sh
# chmod a+x slimserver_standby_daemon.sh - Tips and Tricks
- The standby daemon outputs a log file called standby_daemon.log in SqueezeCenter's log directory (i.e. /ffp/lib/squeezecenter/Logs/). It records the timestamps of the shutdown and startup events which I find useful for tracking the uptimes as well as for debugging purposes.
- The default settings in the standby daemon script does not shutdown MySQL. (My instance of MySQL is used for other purposes hence I have to let it run independently). If you wish to have the script manage that, change the var $stop_mysql from 0 to 1. The script will, however, start MySQL if its not already running regardless of this setting. (Make sense right?!)
A couple of things still need to be sorted out in this setup:
- Wakeup prior to alarm - Since SqueezeCenter is no longer running all the time, alarms that plays from SqueezeCenter will not work. Initial idea is to modify script to set up a cron job to wake SqueezeCenter a few minutes prior to the alarm being triggered. Note that this should not affect you if your alarms are set on SqueezeNetwork and you have configured Server Power Control to automatically switch you to SqueezeNetwork when SqueezeCenter is being shutdown.
- Scheduled music library scans - Since SqueezeCenter is no longer running all the time, the scheduled daily scans may not be taking place anymore. Initial idea is to modify script to look for this setting and setup a cron job for it when the daemon is active.