[LIVE] Run script from remote.xml, stop XBMC but keep script running

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
wronex Offline
Junior Member
Posts: 7
Joined: Jun 2010
Reputation: 0
Question  [LIVE] Run script from remote.xml, stop XBMC but keep script running
Post: #1
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.
find quote
jhsrennie Offline
Team-XBMC Developer
Posts: 7,236
Joined: Nov 2008
Reputation: 119
Location: Chester, UK
Post: #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
find quote
wronex Offline
Junior Member
Posts: 7
Joined: Jun 2010
Reputation: 0
Post: #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.
find quote
wronex Offline
Junior Member
Posts: 7
Joined: Jun 2010
Reputation: 0
Post: #4
I have tried "sudo /etc/init.d/xbmc-live restart" without luck...
find quote
jhsrennie Offline
Team-XBMC Developer
Posts: 7,236
Joined: Nov 2008
Reputation: 119
Location: Chester, UK
Post: #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
find quote
wronex Offline
Junior Member
Posts: 7
Joined: Jun 2010
Reputation: 0
Post: #6
Can't say I'm any good at Python. But I will give it a try!

Thanks for the help jhsrennie!
find quote