I tried the nodm approach and had a bad crash concerning audio device at first. After this i used console kit to start it.
I do not know if it is better, though you can try it out by:
sudo apt-get remove lightdm && sudo apt-get install nodm
edit your /etc/default/nodm config to look like this:
Code:
# nodm configuration
# Set NODM_ENABLED to something different than 'false' to enable nodm
NODM_ENABLED=true
# User to autologin for
NODM_USER=[b]xbmc[/b]
# xinit program
NODM_XINIT=/usr/bin/xinit
# First vt to try when looking for free VTs
NODM_FIRST_VT=7
# X session
NODM_XSESSION=/etc/X11/Xsession
# Options for the X server
NODM_X_OPTIONS='vt7 -nolisten tcp'
# If an X session will run for less than this time in seconds, nodm will wait an
# increasing bit of time before restarting the session.
NODM_MIN_SESSION_TIME=60
After this you have to create
.xsession file your xbmc users home. In my case it is:
/home/xbmc/.xsession with the following content:
Code:
exec ck-launch-session xbmc-standalone
If i ommited the ck-launch-session i had sever problems concerning audio and stuff i did not have before.Boot time is about the same. What perhaps is important for users who want to unmount local drives from within xbmc. nodm does not set the session active, so it does not allow to umount drives.
I worked around this by polkit and a udev rule. The udev rule just mounts whatever it gets read only with xbmc user as owner (ids hardcoded). I found this script somewhere on this forum and adapted it, to auto mount every drive from sdb - sdz which is plugged into usb:
/etc/udev/rules.d/11-media-by-label-auto-mount.rules
Code:
KERNEL!="sd[[b]b-z[/b]][0-9]", GOTO="media_by_label_auto_mount_end"
# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"
# Global mount options
ACTION=="add", ENV{mount_options}="ro"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,uid=[b]1001[/b],gid=[b]1001[/b],umask=002"
# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"
# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
# Exit
LABEL="media_by_label_auto_mount_end"
And at last the correct rights to umount:
/etc/polkit-1/localauthority/50-local.d/custom-actions.pkla
Code:
[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
Ah, what i forgot: nodm does not stop plymouthd, so I added infront of the exit 0 to /etc/rc.local:
Update:
At least on one of my computers it breaks suspend.