How can I have XBMC auto-restart if it crashes?
#1
I've read the Tips and Tricks sticky and have searched but those methods don't seem to work for me.

With my setup, startx launches X + XBMC and when I quit XBMC it kills X.

How can I have XBMC (and X) automatically restart if XBMC crashes?

EDIT: What about a cron script checking if "startx" is running every 10 seconds? Would that slow the system down?
Reply
#2
Please search, this question has been asked and resolved many times.
Reply
#3
instead of just having a script, since i have my harmony remote setup using LIRC, i just use a button to restart it. No need to grab my keyboard, mouse, or vnc anymore.

http://forum.xbmc.org/showthread.php?tid=46211
Motherboard P5N7A-VM, E8400 C2D 3.0 processor. NVIDIA 9300 graphics card. OpenELEC Stable - Generic x86_64 Version:3.2.4
Reply
#4
I did search but I'm still having problems. Sad

I've been able to setup lirc + irexec and it's working but I can't seem to restart X properly.

For example, inside my .lircrc I have:

[...]
# Force kill XBMC
button = LiveTV
config = killall xbmc
[...]

This works and successfully kills XBMC which in-turn kills X. However, tty2 is stilled logged in (because it's set to autologin) and just sits at a command prompt.

[...]
# Start XMBC/X
button = Record
config = startx
[...]

That doesn't seem to work though. I don't see any errors but I'm not sure why it's not working.

I think what I need to do is restart tty2 which will restart X:

initctl stop tty2
initctl start tty2

This successfully restarts tty2 and thus restarts XBMC successfully. Is this the best way to restart XBMC? (I've used the XBMC installation guide from the Wiki so I have Ubuntu 8.10 minimal installation and don't have a full X desktop environment, etc).
Reply
#5
not sure if i follow you all the way as i have the full gnome desktop installed. One thing that helped me though was running the irexec from the command line or ssh environment. this way since its not a daemon thread you can see the output. Also, in order for it to start up my xbmc again i needed to set the DISPLAY variable. maybe this is why the startx is not working.

I believe i had to do something line add "DISPLAY:0 to the beginning of my config (i.e. config = DISPLAY:0 /usr/bin/xbmc)
Motherboard P5N7A-VM, E8400 C2D 3.0 processor. NVIDIA 9300 graphics card. OpenELEC Stable - Generic x86_64 Version:3.2.4
Reply
#6
Waking up the thread to put some info here.

The correct way of doing this would be to change your runlevel settings, for example in /etc/inittab

Code:
x:5:once:/bin/su XBMC_USER -l -c "/bin/bash --login -c /usr/bin/startx >/dev/null 2>&1"

This says "login as user in runlevel 5 and run startx as that user". Make sure that your default runlevel is set to 5.

No password required, and when X dies, it will be restarted.

See here.
Reply

Logout Mark Read Team Forum Stats Members Help
How can I have XBMC auto-restart if it crashes?0