Kodi Community Forum

Full Version: Write script to auto start XBMC after freeze or crash.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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>
Are you trying to automate this or do you just need to activate a script manually (via your remote) when XBMC is not responding ?
(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.
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.
(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.
Does that mean the script would constantly ping XBMC ?
(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?
Download a program called Lingon from the app store ($4.99) and XBMC will always reopen after a crash
Enable the webserver or upnp for the remote and you have a port to ping