PDA

View Full Version : Restart from URL?



twynne
2008-12-10, 10:32
Not sure if this is the best forum for this query, but none of them seemed a perfect fit. Please relocate if appropriate.

I'm just wondering if it's possible to issue a 'restart' command to SC via a URL. As I've moved to 7.3 and seem to be beta testing a number of plugins as well (informally) I'm quite often restarting SC. As my server runs headless it's a bit of a pain at times restarting it (this on Mac OS).

Thanks,

Tom

erland
2008-12-10, 11:36
You can't do it though the SqueezeCenter software, but if you also have a standard web server installed there might be possible to do it through some cgi scripts.

It's planned to make this easier in future version as the new Extension Downloader module in the upcoming SqueezeCenter 7.3 will require it after a new plugin has been installed. There is nothing regarding simple restarts in 7.3.0 though, so you will have to wait at least for 7.3.1.

mswlogo
2008-12-10, 11:47
There is a service for Windows that can do this. That you can just poke it to restart the whole server. I imagine something similar exists for Unix. In fact you could probably write a cron script to do it. By just creating a file for example it will see it and restart a daemon or the machine.

For example here is a cron tab that restarts appache.

http://www.richardpalace.com/2008/05/14/cron-job-restart-apache

But instead have it check for the existence of a reboot file (much more frequenctly, say every 10 seconds). Push the file onto the server remotely by what ever means, The cron tab script sees it, deletes the file, and restarts service (or reboots machine).

twynne
2008-12-10, 12:01
Thanks for the responses guys. The first sounds like it may help when 7.3.1 arrives, and the second at least suggests another possible solution - what about a simple Applescript? I can almost certainly write one to end the process, then presumably there's a way to launch one as well.

I can only see 'perl' in the list of running processes. Is this the only process to end? And will it respect a request to end, and stop 'properly'? Any thoughts on how to restart it?

As a last alternative there's probably a way to open the System Preferences panel and click the button, but I'd really rather avoid that. Previous attempts at this sort of thing have proven to be messy at best.

twynne
2008-12-10, 12:02
One more thought - can it be done from the CLI? If so is there a reference somewhere?

Thanks! :-)

Tom

aubuti
2008-12-10, 13:28
It's not a URL, but you can do it from your SB remote (including SBC I believe): the ServerPowerControl plugin. It's currently in beta, and working quite well. While the main focus is on shutdown/restart/suspend/hibernate of your server hardware, it also has a feature to send a command to restart SqueezeCenter. Give it a look in the 3rd Party Plugins (http://forums.slimdevices.com/showthread.php?t=48521).

twynne
2008-12-10, 13:46
It's not a URL, but you can do it from your SB remote (including SBC I believe): the ServerPowerControl plugin. It's currently in beta, and working quite well. While the main focus is on shutdown/restart/suspend/hibernate of your server hardware, it also has a feature to send a command to restart SqueezeCenter. Give it a look in the 3rd Party Plugins (http://forums.slimdevices.com/showthread.php?t=48521).

Excellent! That does the trick actually, and you can run it from SqueezePlay so that's quicker than connecting to the server (VNC) and messing around with the preference pane.

Thanks!!