[LIVE] Run script from remote.xml, stop XBMC but keep script running
#1
Question 
I have configured my remote.xml to run a bash script when I press the "Clear" button on my MCE remote control.

The bash script was intended to do the following:
  1. Stop XBMC
  2. Perform some tasks
  3. Start XBMC

But when the script stops XBMC it also kills itself, leaving me with a black screen. Sad The script needs to keep running to perform the tasks and then start XBMC again. How can I achieve this?

If I remember correctly the entry in the remote.xml looks like this:

Code:
<clear>System.Exec("sudo sh /etc/X11/toggle.sh &")</clear>

I have used the following commands to stop and start XBMC (is there a better way?):

Code:
sudo /etc/init.d/xbmc-live stop
sudo /etc/init.d/xbmc-live start

I have disabled the sudo password.
Reply
#2
Presumably the stop command is killing child processes as well, so you need a way to kill a process without killing it's children.

JR
Reply
#3
jhsrennie Wrote:Presumably the stop command is killing child processes as well, so you need a way to kill a process without killing it's children.

Sound correct. Anyone knows how to do that?

Or maybe I can perform the tasks while XBMC is running and then restart it with a single command, thus not getting into the child process problem?

I am trying to change my xorg.conf at run time and without restarting the computer.

Is there a single line command that can be run from bash to restart only the xbmc app.
Reply
#4
I have tried "sudo /etc/init.d/xbmc-live restart" without luck...
Reply
#5
I think Python can create detached processes. You could use a Python script to create a detached process that does whatever you want then restarts XBMC.

JR
Reply
#6
Can't say I'm any good at Python. But I will give it a try!

Thanks for the help jhsrennie!
Reply

Logout Mark Read Team Forum Stats Members Help
[LIVE] Run script from remote.xml, stop XBMC but keep script running0