Write script to auto start XBMC after freeze or crash.

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sdyates Offline
Junior Member
Posts: 6
Joined: Jan 2014
Reputation: 0
Post: #1
I have done a lot of looking today. Most of what I have found comes from xvmc crashing. Most of my problems come from add ons freezing for long periods of time, though crashes do happen.

Is there an api or port I can call to get a message. A port or api that will be silent if the application is frozen. To me frozen is the inability to use standard controls to advance to another screen.

I am not a programmer, but I wrote a script years ago that listened on port 80 for an application an dafter two failed attempts I would force a restart.

I was thinking of using this code as the restart to ensure that all threads are killed, but again, I have no idea how to test XBMC if it is frozen Smile

<code>
sudo su -
killall -9 xbmc.bin
xinit /usr/local/bin/xbmc --standalone &
</code>
find quote
activate Offline
Fan
Posts: 610
Joined: Feb 2011
Reputation: 1
Post: #2
Are you trying to automate this or do you just need to activate a script manually (via your remote) when XBMC is not responding ?

Macmini Server 2011 i7 Quad Core, OS 10.8.2, Amp Onkyo TX-SR308 USB WD drives 3x2TB TV Samsung Plasma 720p EyeTV Integration
There are only 10 kinds of people in this world, those who understand binary, and those who don't.



find quote
sdyates Offline
Junior Member
Posts: 6
Joined: Jan 2014
Reputation: 0
Post: #3
(2014-01-18 14:38)activate Wrote:  Are you trying to automate this or do you just need to activate a script manually (via your remote) when XBMC is not responding ?

I am trying to automate the script. But, I want to make sure I do it the right way. I don't just want to restart XBMC if it fails, but to restart if it freezes or hangs.
find quote
activate Offline
Fan
Posts: 610
Joined: Feb 2011
Reputation: 1
Post: #4
Yeah, I'm not a coder either but I'll be interested to see if you can make this work. I have used an app called Lingon that can restart an app when it crashes. I was talking with its developer and he indicated that its tricky to differentiate between when an pp is unresponsive (temporary state) and frozen.

I have mannual scripts that I evoke via my remote when I encounter it for now.

Macmini Server 2011 i7 Quad Core, OS 10.8.2, Amp Onkyo TX-SR308 USB WD drives 3x2TB TV Samsung Plasma 720p EyeTV Integration
There are only 10 kinds of people in this world, those who understand binary, and those who don't.



find quote
sdyates Offline
Junior Member
Posts: 6
Joined: Jan 2014
Reputation: 0
Post: #5
(2014-01-18 15:08)activate Wrote:  Yeah, I'm not a coder either but I'll be interested to see if you can make this work. I have used an app called Lingon that can restart an app when it crashes. I was talking with its developer and he indicated that its tricky to differentiate between when an pp is unresponsive (temporary state) and frozen.

I have mannual scripts that I evoke via my remote when I encounter it for now.

I wrote a script years ago that would essentially "ping" a port. Whenever the app become unresponsive, the port failed to respond. I waited for two failed responses and then triggered a restart. However, I don't know much about the inner workings of XBMC. I must have some ports that work the same way. Then it is easy to create a script.
find quote
activate Offline
Fan
Posts: 610
Joined: Feb 2011
Reputation: 1
Post: #6
Does that mean the script would constantly ping XBMC ?

Macmini Server 2011 i7 Quad Core, OS 10.8.2, Amp Onkyo TX-SR308 USB WD drives 3x2TB TV Samsung Plasma 720p EyeTV Integration
There are only 10 kinds of people in this world, those who understand binary, and those who don't.



find quote
sdyates Offline
Junior Member
Posts: 6
Joined: Jan 2014
Reputation: 0
Post: #7
(2014-01-19 01:08)activate Wrote:  Does that mean the script would constantly ping XBMC ?

Yes, I can see no other way. However, if there is a better way, I am open to it, but I image a ping every 10 to 60 seconds would not cause a lot of overhead. Or is there a way of making this a kind of system service?
find quote
thefly666 Offline
Junior Member
Posts: 16
Joined: Jun 2010
Reputation: 0
Post: #8
Download a program called Lingon from the app store ($4.99) and XBMC will always reopen after a crash
find quote
Gigantur Offline
Senior Member
Posts: 132
Joined: Dec 2012
Reputation: 0
Location: Melbourne, Australia
Post: #9
Enable the webserver or upnp for the remote and you have a port to ping
find quote