--- /usr/portage/x11-apps/xinit/files/startDM.sh 2007-04-05 17:36:08.000000000 +0200 +++ /etc/X11/startDM.sh 2009-11-29 12:14:39.000000000 +0100 @@ -14,17 +14,28 @@ [ -r "${svclib}"/sh/rc-services.sh ] && . "${svclib}"/sh/rc-services.sh fi -# Great new Gnome2 feature, AA -# We enable this by default -export GDK_USE_XFT=1 - export SVCNAME=xdm + EXEC="$(get_options service)" NAME="$(get_options name)" PIDFILE="$(get_options pidfile)" +XUSER=my_user_to_autologin +PIDFILE=/var/run/startx.pid + +if test -z "${XUSER}"; then + # Great new Gnome2 feature, AA + # We enable this by default + export GDK_USE_XFT=1 -start-stop-daemon --start --exec ${EXEC} \ -${NAME:+--name} ${NAME} ${PIDFILE:+--pidfile} ${PIDFILE} || \ -eerror "ERROR: could not start the Display Manager" + + start-stop-daemon --start --exec ${EXEC} \ + ${NAME:+--name} ${NAME} ${PIDFILE:+--pidfile} ${PIDFILE} || \ + eerror "ERROR: could not start the Display Manager" +else + env USER=${XUSER} HOME=$(getent passwd ${XUSER}|cut -d: -f6) \ + start-stop-daemon --start --background --make-pidfile -c ${XUSER} --exec ${EXEC} \ + ${NAME:+--name} ${NAME} ${PIDFILE:+--pidfile} ${PIDFILE} || \ + eerror "ERROR: could not start ${EXEC} for ${XUSER}" +fi # vim:ts=4