Restarting xbmc?
#1
Question 
Hi.
This feels likea really stupid questions, but how does one restart xbmc? Quite often when testing things out xbmc hangs and I just want to restart it completely. The usual stuff (like "service xbmc restart", "service xbmc-live restart", just killing xbmc processes etc) doesn't work at all for me so I always end up having to reboot entire htpc. Is this only me being stupidHuh

I'm running latest git version of xbmc on a Ubuntu Natty OS, installed from the official unstable ppa. I don't think I've done anything fancy to my daemons, but this is a system that has been upgraded in steps from Hardy and whatever xbmc version was the latest then. And I'm not running any window managers or such, just pure xbmc.

/Daniel
Reply
#2
You can try mapping a button on the remote with XBMC.RestartApp()

I use the zero button under global.

<zero>XBMC.RestartApp()</zero>


However, if xbmc is hung its unlikely this will do the job but you can use a script that can be called by irexec thats mapped to a button on the remote.
Reply
#3
Yes, this is for scenarios in which xbmc is completely hung and doesn't respond at all. Big question is what the script should look like for restarting xbmcHuh

/Daniel
Reply
#4
Code:
#!/bin/sh
#
# kill xbmc by force
#
pkill -9 xbmc.bin
sleep 2

#
# start xbmc again
#
xbmc  # you might need to edit this with the full path

if [ $? -eq 0 ]
then
     exit 0
else
     echo "error starting xbmc"
     exit 1
fi
Reply
#5
I think you're missing my point here. If it were something that simple, just starting xbmc, it wouldn't be any problem. What I want to do is start it as a daemon, just like it's done at boot time. Like I said, my first thought was to run a "service xbmc-live start", but that just doesn't do anything at all and I don't understand why.

/Daniel
Reply
#6
The way I have mine setup is described in this post:
http://forum.xbmc.org/showpost.php?p=894602&postcount=2

Then if xbmc stops responding, it's as simple as:
ps aux | grep xbmc
sudo kill PID

That kicks XBMC in the guts and restarts again!
Reply
#7
Daniel Malmgren Wrote:I think you're missing my point here. If it were something that simple, just starting xbmc, it wouldn't be any problem. What I want to do is start it as a daemon, just like it's done at boot time. Like I said, my first thought was to run a "service xbmc-live start", but that just doesn't do anything at all and I don't understand why.

/Daniel

And you are missing the point of a simple solution, as the one I provided. There is no need to start it as a service from a restart script.
Reply
#8
I still think this is really strange. I've just installed xbmc using the packages by team xbmc and it starts using the standard stuff that comes in the package. It feels like a messy solution to start writing my own init scripts just because the standard script doesn't support restarting xbmc, doesn't it? Shouldn't there be standard way of doing this?

/Daniel
Reply
#9
I don't use XBMC live, so I'm not familiar with the specifics, but since it does start automatically on boot and shuts down on system shutdown, there surely is a standard script that does excatly that.

What you want is not the same though. You need something in case xbmc becomes unresponsive(which actually _should_ never happen), ergo a _workaround_.
Reply
#10
No. What I need is a way to simply stop a running daemon that has been automatically started at booting time. With every normal daemon I know a simple "service <name> stop" works. With the xbmc-live daemon it doesn't, no matter if xbmc is hanged or not. This is obviously an error.

Btw, I tried simply killing everything xbmc related and trying to start it again by just running it from the command line. What happens then is (quite naturally) that I get "Error: unable to open display", since there is now no X running at all. The point with starting it as a daemon is that the daemon script handles all that and starts Xorg and xbmc.

/Daniel
Reply
#11
Daniel Malmgren Wrote:Btw, I tried simply killing everything xbmc related and trying to start it again by just running it from the command line. What happens then is (quite naturally) that I get "Error: unable to open display", since there is now no X running at all.
/Daniel

How did you do this?
What interface are you using?
Via ssh?

Explain in detail please.
Reply
#12
... The reason I went for my method was because the new xbmc-live script was using uxlaunch, which I could not do a simple 'service xbmc-live stop' it would state that the process wasn't started.

Trying to do a 'service uxlaunch stop/start' would not work - I would have to kill the 'Xorg' process which was running as root - Then I could do a 'service uxlaunch start' this would then fire up xbmc again.

The other reason for my approach was that I was using the AudioEngine branch, and using the xbmc-live daemon to start the service would result in not being able to get any PCM audio - NOTHING I tried worked!

Previously the old xbmc-live package which is bundled in the stable release worked exactly as how you wanted it - You could do a 'service xbmc-live stop/start' and it would do just that, now with uxlaunch it just never did work for me!
Reply

Logout Mark Read Team Forum Stats Members Help
Restarting xbmc?0