(2013-05-03, 08:44)fritsch Wrote: No, using both is contraproductive. Both try to start xbmc, one as a session via lightdm, one even with own xserver. Remove one of them. Btw. the script you linked could end you up without sound devices, cause there is no waiting for udev trigger / settle.
Well thanks, I removed the /etc/init.d/xbmc script and now it does NOT boot into XBMC, but Ubuntu desktop. Which makes sense, because I had trouble getting the lightdm/xsession-approach to work properly before, and then I tried the script linked to in my previous post and saved it as /etc/init.d/xbmc - and bam it worked.
Btw, my "lightdm/xsession" approach involves creating a /usr/share/xsessions/XBMC.desktop file as outlined in this thread, and then configuring /etc/lightdm/lightdm.conf to use it at boot. But this has not worked for me.
What I make of this is that the init.d or xinit or whatever you want to call it -approach works, while lightdm session config doesn't. Which I don't really understand, as lightdm should be the "better" approach for Ubuntu 12.10, which I am running.
I'll paste my scripts/configs below, just so it's clear what I'm doing:
Certainly there is the chance that I have configured lightdm.conf and the .desktop file wrongly, but I really did try quite a bit to make it work without success.
/etc/lightdm/lightdm.conf:
PHP Code:
[SeatDefaults]
autologin-guest=false
autologin-user=my-user
autologin-user-timeout=0
user-session=XBMC
/usr/share/xsessions/XBMC.desktop:
PHP Code:
[
Desktop Entry]
Name=XBMC
Comment=This session will start XBMC Media Center
Exec=xbmc-standalone
TryExec=xbmc-standalone
Type=Application
greeter-session=lightdm-gtk-greeter
/etc/init.d/xbmc:
PHP Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides: xbmc
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts instance of XBMC
# Description: starts instance of XBMC using start-stop-daemon and xinit
### END INIT INFO
############### EDIT ME ##################
# path to xinit exec
DAEMON=/usr/bin/xinit
# startup args
DAEMON_OPTS=" /usr/bin/xbmc-standalone -- :0"
# script name
NAME=xbmc
# app name
DESC=XBMC
# user
RUN_AS=my-user
# Path of the PID file
PID_FILE=/var/run/xbmc.pid
############### END EDIT ME ##################
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo "Starting $DESC"
start-stop-daemon --start -c $RUN_AS --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
;;
stop)
echo "Stopping $DESC"
start-stop-daemon --stop --pidfile $PID_FILE
;;
restart|force-reload)
echo "Restarting $DESC"
start-stop-daemon --stop --pidfile $PID_FILE
sleep 5
start-stop-daemon --start -c $RUN_AS --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0