XBMCbuntu - Run script on startup?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
addictweb Offline
Junior Member
Posts: 6
Joined: Mar 2012
Reputation: 0
Question  XBMCbuntu - Run script on startup?
Post: #1
I have written a script to enable xboxdrv with 4 controllers to use with mupen64 under XBMCbuntu. The script runs fine when i navigate to its location and type "$script start"

I've made it executable: $chmod +x script

Its located in /etc/init.d/

I've installed it with $sudo update-rc.d script defaults which works, trying to run it again confirms the start and stop links already exist.

However when I boot it doesn't run. I cant work out why, I assume XBMCbuntu should run startup scripts like normal ubuntu?

Any ideas welcome!
find quote
harryzimm Offline
Posting Freak
Posts: 852
Joined: May 2008
Reputation: 6
Location: Auchtermuchty, Scotland
Post: #2
Hi,

try adding it to /etc/rc.local

cheers

HTPC 1 : Acer revo R3700 ion2 HTPC 2 :Apple TV2 HTPC 3 : Apple TV2 HTPC4 Acer revo R3700 ion2 Remote : x2 Riimote2
SERVER : 10TB Ubuntu Server 10.04, dual wintv nova hd s2 cards, tvheadend, Newcs, Omnikey reader, White *Sky uk* Card, Mysql Db, Sabnzbdplus, SickBeard, Couchpotato, FlexRaid. :cool:
--------------------------------------------
[Image: widget]
find quote
opensauce Offline
Member
Posts: 64
Joined: Jan 2010
Reputation: 0
Post: #3
what he said--^ Be sure to put in the complete path to the script as well.
find quote
addictweb Offline
Junior Member
Posts: 6
Joined: Mar 2012
Reputation: 0
Post: #4
opensauce Wrote:what he said--^ Be sure to put in the complete path to the script as well.

Thanks guys, gave that a try. My rc.local now looks like the below but it still does not run.

Quote:#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Start xboxdrv controllers using custom start-up script

/home/xbmc/xboxdrv/xboxdrv start

exit 0

That exact command "/home/xbmc/xboxdrv/xboxdrv start" works when put directly in the terminal. I dont need to sudo or anything so I assume its not a permission issue.

The script outputs logs to file but no logs are created on boot suggesting the script is not executed at all.

Am I missing something?
(This post was last modified: 2012-03-06 22:33 by addictweb.)
find quote
addictweb Offline
Junior Member
Posts: 6
Joined: Mar 2012
Reputation: 0
Post: #5
I thought it might be something to do with the /home/ directory so I moved the script to /etc/xboxdrv - still no luck on boot but fine from xTerm. Both the script and rc.local are executable as well.

Ideas?
find quote
erhnam Offline
Team-XBMC Live Developer
Posts: 673
Joined: May 2009
Reputation: 2
Location: The Netherlands
Post: #6
XBMCbuntu uses the /etc/xbmc/ dir for script execution at boot.

/etc/xbmc/setup.d/ -> these script are executed once (at installation boot time)

/etc/xbmc/live.d/ -> these scripts are executed every time xbmc starts

You might try to add your script to the /etc/xbmc/live.d/ directory.
find quote
addictweb Offline
Junior Member
Posts: 6
Joined: Mar 2012
Reputation: 0
Post: #7
Perfect, thanks.

It didnt work in setup.d but worked in /etc/xbmc/live.d/

I now have working xbox controllers on boot!
find quote
bilbonvidia Offline
Fan
Posts: 459
Joined: Jun 2011
Reputation: 2
Location: Britain
Post: #8
Is there some other way to run a script automatically?

I have created ati.sh in live.d with

DISPLAY=:0 aticonfig --pplib-cmd "set fanspeed 0 10"

but for some reason it does not seem to run. It runs fine form the command line when logged on. (xbmcbuntu)
find quote
bilbonvidia Offline
Fan
Posts: 459
Joined: Jun 2011
Reputation: 2
Location: Britain
Post: #9
solution dlast ubuntu forums

I made it work by putting the command into a script (/usr/local/bin/setfanspeed ; don't forget to chmod +x setfanspeed) and setting this script in /etc/lightdm/lightdm.conf : adding a line
display-setup-script=/usr/local/bin/setfanspeed

for debugging the script startup you can also add some redirection of the output and log it into a file:
DISPLAY=:0.0 aticonfig --pplib-cmd "set fanspeed 0 20" 2> /tmp/setfanspeed.err.log > /tmp/setfanspeed.log
find quote
paperwaste Offline
Junior Member
Posts: 1
Joined: Jun 2012
Reputation: 0
Post: #10
hi i have a script to set the overscan/underscan for my monitor because ATI are a pack of fools and don't have a configuration for this in CCC

Quote:#!/bin/bash

aticonfig --set-dispattrib=dfp1,positionX:48
aticonfig --set-dispattrib=dfp1,positionY:27
aticonfig --set-dispattrib=dfp1,sizeX:1824
aticonfig --set-dispattrib=dfp1,sizeY:1027

i have saved it in /etc/xbmc/setup.d/ and have made it executable, it runs fine in the terminal and the file browser but does not run on startup, i have tried saving it in live.d also and that does not help
find quote
MArKiTo79 Offline
Junior Member
Posts: 1
Joined: Oct 2012
Reputation: 0
Post: #11
(2012-03-19 21:31)addictweb Wrote:  Perfect, thanks.

It didnt work in setup.d but worked in /etc/xbmc/live.d/

I now have working xbox controllers on boot!

Hi addictweb.
Would you mind sharing the script you've put in the directory /etc/xbmc/live.d please? What is the filename of the script?
I managed to get it working as explained here: http://forum.xbmc.org/showthread.php?tid=98824
But when I call that script in rc.local, it doesn't work after reboot. When I read that you got it working, I'm happy for you but I want that too Big Grin

Thanks already!
find quote