XBMCbuntu - Run script on startup?
#1
Question 
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!
Reply
#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
Reply
#3
what he said--^ Be sure to put in the complete path to the script as well.
Reply
#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?
Reply
#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?
Reply
#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.
Reply
#7
Perfect, thanks.

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

I now have working xbox controllers on boot!
Reply
#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)
Reply
#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



Reply
#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
Reply
#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!
Reply

Logout Mark Read Team Forum Stats Members Help
XBMCbuntu - Run script on startup?0