I can't claim this as my project. Adrian C did all the initial work for the windows SS6.5 version. See http://adrianonline.wordpress.com/projects/squeezebox/ But thanks again for the helpful Debian instructions.
Yes, this is a bug. Harmless, but annoying. I'll need some help from Ben Klass or somebody else suitably jiveariffic to fix this, I think.
I'm confident that Richard's work on the SBC code will sort out all the WOL issues MUCH sooner than I could even dream of implementing a feature like this. Thanks for confusing me with a perl/lua programmer with other than my very rudimentary skills, though.
Results 21 to 30 of 2061
-
2008-06-23, 20:57 #21
-
2008-06-25, 20:24 #22Senior Member
- Join Date
- Apr 2008
- Location
- Paris, France
- Posts
- 1,469
I think it does already. I tested this on X.5.3 but I guess most versions of OS X will work as well:
- 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 #23
Originally Posted by gharris999
I must've miss the 7.1 requirement, I have now upgraded to 7.1 now and the plugin's Shutdown Server and Restart Server are working correctly, I can see the Squeezebox turns off correctly.
Originally 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 :)
http://www.last.fm/user/pichonCalavera
-
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 #26Hey!, thanks for the tip, IRBlaster is now working fine just like before.
Originally 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 :)
http://www.last.fm/user/pichonCalavera
-
2008-06-27, 07:36 #27
I have a long time-out hard-coded in that version. That's to allow a SBC to "follow along" when the player switches over to squeeze network. With my setup, it takes at least a minute+ for this to happen. Thus, I set the shutdown wait period to 2 minutes. Conceivably, I could make this a user configurable setting in a future version.
-
2008-06-27, 08:14 #28
If the change that Phil proposes ever makes it into the server code, it shouldn't be too hard to add that functionality to "my" plugin. Or for that matter, make a generic "OnSleepEnd" plugin that would execute any user configurable CLI command.
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 #30Member
- Join Date
- May 2007
- Posts
- 39
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.
Thanks
Edit-------------
I have found a copy of the sudo package for freebsd that seems to work on SlimNAS
ftp://ftp.freebsd.org/pub/FreeBSD/po...1.6.9.15_1.tbz
pkg_add sudo-1.6.9.15_1.tbz
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.
Cheers
MarkLast edited by fredbloggs; 2008-07-03 at 18:09.


Reply With Quote
