Kodi Community Forum

Full Version: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
mind the typo I corrected it Wink
I see, thanks again. ;-)
(2012-10-12, 08:24)Hack_kid Wrote: [ -> ]in regards to the upstart job instructions, what is this for?

sudo ln -s /lib/init/upstart-job /etc/init.d/xbmc

why do we need to make a shortcut to lib/init/upstart-job? it doesnt make sense upstart jobs are executed from the .conf files in the init folder nothing more. and those conf files tell the system what to do which in this case is run runXBMC which resides in uxr/bin/runXBMC just a little cunfused here

Some further googlefu also indicates that this is done mainly for backwards compatibility...there is only the symbolic link added after all. Run a ls -als /etc/init.d/ and you'll see that most of the services are linked that way.



weirdnesses Wrote:#!/bin/sh -e
# upstart-job
#
# Symlink target for initscripts that have been converted to Upstart.

I suppose if it was a proper upstart job to begin with, it wouldn't need symlinking.
@uNiversal - yes, it seems like the symlinks are in place simply for legacy uses. ;-)

Hence the warning you get when running a given service through /etc/init.d/
Code:
~$ sudo /etc/init.d/gdm status
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service gdm status

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the status(8) utility, e.g. status gdm
gdm start/running, process 1145
~$
I've made version 2.5.0 available (start post updated)

Upstart doesn't seem to have a lot of impact on the boot time. Maybe it adds a second or so, but I haven't timed it.

* Added upstart option (choose between init.d and upstart)
* Remove apparmor (speed optimization)
* Automatic video driver selection (only NVIDIA driver tested)
* Added script that should allow for waking up the machine with your remote (only some remotes are supported; I'm unable to test this so please inform me about your findings).
* Some general optimizations and bug fixes in the scripts code

Thanks for figuring out the upstart method thethirdnut!

I've used this script http://rt-tsp.googlecode.com/svn-history...ll/xbmc.sh , this topic http://forum.xbmc.org/showthread.php?tid=114368 and thethirdnut's suggestions for additions and optimizations to this version.

On my machine the installation completes successfully but I get an error about the apt cache. I'm pretty sure this is because I've run the script a lot of times (and interrupted it several times). Please let me know if you get the same error. I don;t think it has caused any problems on my machine.
I haven't tried a clean install with the modifications. I didn't change anything radical, except for adding the optional upstart script. I would be surprised if there are problems on a clean install.
Fanstastic, great work.

Here's something to look at http://forum.xbmc.org/showthread.php?tid...pid1093119 fixes automount issues (if there is any that are un-addressed by script. I didn't look to see if this is a problem to begin with.

@ bram77 could you paste the output of
Code:
sensors
to see if the monitoring chip is recognized properly (presuming you install lmsensors)?
lmsensors is an optional package to install. I'll have a look! Thanks for pointing that out.
Tested script 2.5

Using the upstart route in the script, not sure if that is vital for the information below.

Works well except for an error on installing the boot screen, it was stuck on that screen for a long time, so i press enter and it asked me for a sudo password.
After that the script went on doing it's thing.

Power management package takes a long time, could use a warning for that.

after reboot:

Boot screen does not show, getting the 12.10 boot screen and a login screen.
XBMC starts up automatically.
Super, thanks for the feedback. I'll look into the bootscreen issue.
heres a better upstart script that doesnt rely on an external shell script to boot (seemed pretty redundant to me)

has all the same features as the other one just written properlyHuh?? (could be completely wrong here looks good here though.

Code:
# xbmc-upstart
# starts XBMC on startup using xinit and the startx command. Runs as xbmc as user
description     "XBMC-barebones-upstart-script"
author          "Matt Filetto"

start on (filesystem and stopped udevtrigger)

stop on runlevel [016]

# tell upstart to respawn the process if abnormal exit
respawn

script
  exec su -c "startx /usr/bin/xbmc --standalone :0" xbmc
end script
Excellent! I'll have a look at it. If it restarts XBMC properly after a crash I'll replace the existing one with this one.
@Hack_kid

Does this work any better as far as loadtime, does respawning work, etc? If so please let me know and I'll try it out as well.

upstart is a replacement for init while startx script is a frontend for xinit, idk which is more efficient faster and does what's required in starting X... often the best solutions are simple, however it seems that using a frontend instead of handling the processes directly could be counter intuitive. yet this is only a observation not a expert comment.

I found the post where this the author? of the "new" script hack kid posted came from or was adapted from, http://askubuntu.com/questions/9783/how-...-pre-login

Its says under the entry:

Quote:The startx command uses .xinitrc in the home directory of the user it is running under. In this case, I simply start xbmc, no window manager is needed. Note that the user you use to run startx might need to be a member of certain groups for this to work. I believe at least the video group is needed for X to work, but I'm not sure.

uNi
@uNiversal

Agreed, but the main benefit that using Upstart gives us is that if XBMC crashes - which can happen often when switching display rate, development branches, etc - is that'll automatically restart / respawn XBMC for you.

The /etc/init.d/ SysV implementation works well on startup + very lightweight, but most of us don't want to have to reconnect to box to reload XBMC.

My 3 & 6 yr-old's for instance often forget the ssh pass-phrase. Big Grin


Quote:The startx command uses .xinitrc in the home directory of the user it is running under. In this case, I simply start xbmc, no window manager is needed. Note that the user you use to run startx might need to be a member of certain groups for this to work. I believe at least the video group is needed for X to work, but I'm not sure.

Agreed on this too - I believe with Hack_Kid's approach you'll still need to have an .xinitrc or .xsession file defined at some point too since as you say that's what startx uses...have to define this on FreeBSD for instance since it doesn't come with a Desktop installed either...