http://adrianonline.wordpress.com/projects/squeezebox/ But thanks again for the helpful Debian instructions.
Results 21 to 30 of 2153
2008-06-23, 20:57 #21
2008-06-25, 20:24 #22
- Join Date
- Apr 2008
- Paris, France
- Install the plugin in ~/Library/Application Support/SqueezeCenter/Plugins
- In the subroutine sub doSystemShutdown() of file Plugin.pm, make the following changes:
a) comment out the "shutdown -r" (= reboot) lines
# system "sudo", '/sbin/shutdown', '-r', 'now';
and replace them with the following:
system '/usr/bin/osascript', '-e', 'tell app "Finder" to restart';
b) comment out the "shutdown -h" (=halt) lines
# system 'sudo', '/sbin/shutdown', '-h', 'now';
and replace them with this:
system '/usr/bin/osascript', '-e', 'tell app "Finder" to shut down';
or that (which is probably safer):
system '/usr/bin/osascript', '-e', 'tell app "Finder" to sleep';
No need to muck with sudo settings and that's a good thing, me thinks.
Now there are a few caveats, here:
1. On a desktop, and particularly on a multi-user machine like OS X, shutting down may not be such a great idea. That's why I suggest using "sleep" instead of shutdown
2. To avoid losing data upon a shutdown or reboot, opened applications will offer to save documents or cancel shutdown. In case no one responds to applications prompts the shutdown times out. So you can't be certain the Mac will indeed stop or restart. But SC will die anyway I think.
3. Perhaps you think you can log out and keep SC running in the background. Well that's certainly the way to go, but the Login Window is not as scriptable, AFAIK. You can't "tell app "Login Window" to shut down".
So I believe the clean way of doing it is to write a small launchd Daemon that will have the power to shutdown/reboot the machine in the unix way; I suggest the deamon should check (with "who" ?) and refuse to shutdown or reboot if user sessions are opened on the machine or if SC is not running. I believe this would work on X.4 and X.5 machines.
In order to support X.3 and prior systems the StartupItem init scheme should be used instead of Launchd.
If you're interested, have a look at http://developer.apple.com/technotes/tn2005/tn2083.html for authoritative info on the topic.
I have little interest, time and skills to code and test this myself.
2008-06-25, 22:24 #23Originally Posted by gharris999Originally Posted by epoch1970
Shutdown to SqueezeNetwork connects to Squeezenetwork correctly, but for some mysterious reason my Squeezebox displays Signing Off of Squeezenetwork, I'll try to replicate it again.
Unfortunetly now IRBlaster is the one not working, i hope it gets supported for SC 7.1 soon.rip (eac) > convert (flac) > tag (musicbrainz/mp3tag) > normalize (replaygain/foobar2000) > albumart (www/firefox) > transport (winscp) > store (debian) > manage (squeezecenter) > control (ipodtouch/ipeng-app) > play (squeezebox) > preamplify (zpre2) > amplify (zampv3) > listen (axiomm2/sennheiser-hd595) > scrooble (last.fm) > enjoy (me :)
2008-06-26, 13:18 #24
2008-06-26, 13:20 #25
epoch1970: thanks for the mac info. I'm working on an updated version that keeps the various shutdown/suspend/hibernate commands in prefs. That way, I'm hoping that OSX can be supported without having to edit the code. I hope to have this next version out in a day or so.
2008-06-26, 22:24 #26Originally Posted by gharris999
I tried the Shutdown to Squeezenetwork and it worked fine this time, altough it takes a longer time to shut the server down for some reason.
As for a feature request, it would be cool to have an option for the sleep request on the Squeezebox, so that you could Shutdown the server too. Something like what these guys are trying to accomplish: http://forums.slimdevices.com/showthread.php?t=49013 .rip (eac) > convert (flac) > tag (musicbrainz/mp3tag) > normalize (replaygain/foobar2000) > albumart (www/firefox) > transport (winscp) > store (debian) > manage (squeezecenter) > control (ipodtouch/ipeng-app) > play (squeezebox) > preamplify (zpre2) > amplify (zampv3) > listen (axiomm2/sennheiser-hd595) > scrooble (last.fm) > enjoy (me :)
2008-06-27, 07:36 #27
2008-06-27, 08:14 #28
Since the SrvrPowerControl plugin adds the ability to initiate a shutdown/suspend/hibernate/switch to SN via the CLI, a OnSleepEnd plugin could easily make that call.
A less elegant short-term solution would be for you to modify the plugin code and add a new menu item "Sleep 15 then shutdown". The next version of the plugin that I post up here will be much easier to modify in this regard.
Last edited by gharris999; 2008-06-27 at 08:18.
2008-06-27, 20:45 #29
I suppose one circumstance where this would be handy is where the user wants to listen to 15 minutes of music on "sleep" mode; have the player then switch to squeeze network (where they might have an alarm set) and power off the local server. This actually sounds handy to me. But the right way to do it is the way Phil is suggesting.
2008-07-03, 17:45 #30
- Join Date
- May 2007
Can't get it working on SlimNAS (FreeNAS)
Appears as though I don't have Sudo, have tried pkg_add -r sudo but the package is not available on the freebsd repository (anyone know how to install SUDO in FreeNAS?)
Your plugin does in fact shutdown squeezecentre so perhaps I'll work on a cron job in SlimNAS that determines whether anyone is using the system as a NAS server and then see if SqueezeCentre is running.
Gives me a partial option.
I have found a copy of the sudo package for freebsd that seems to work on SlimNAS
However, i'm still in a situation whereby it only shutsdown squeezecentre. A little further investigation shows that mysqld & perl are running as 'root', and I don't have /etc/init.d directory.
What command is the plugin trying to call to shutdown the server, i'm sorry but programming isn't my bag and I can't really understand this at the moment.
I should add, I'm running squeezecenter-7.1-21304-noCPAN.
Also, in testing with SoftSqueeze, it doesn't shutdown the SoftSqueeze client.
Last edited by fredbloggs; 2008-07-03 at 18:09.