2012-10-16, 19:06
@thethirdnut LOL
![Big Grin Big Grin](https://forum.kodi.tv/images/smilies/grin.png)
(2012-10-16, 18:58)thethirdnut Wrote: @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.
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...
# 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
sudo ln -s /lib/init/upstart-job /etc/init.d/xbmc
sudo sh -c 'echo "allowed_users=anybody" >> /etc/X11/Xwrapper.config'
#sudo mv /etc/init/tty6.conf /etc/init/tty6.conf.bak
# xbmc-upstart
# starts XBMC on startup by using xinit.
# by default runs as xbmc, to change edit below.
env USER=xbmc
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 "xinit /usr/bin/xbmc --standalone :0" $USER
end script