Re: LXDE and THE DM and my lxdm
Posted: Mon Sep 07, 2009 4:14 pm
in fedora you need pam-devel and libXmu-develto compile it, others may something else.
it can run as daemon, use lxdm -d, and have pid file default at /var/run/lxdm.pidanubisg1 wrote:2 important features you should add are:
capability to run it as a daemon (and then using a PID file)
capability to have a LOG file
works fine, but on openSUSE it's not able to run the consolekit session
Code: Select all
# Largely adapted from xdm's init script:
# Copyright 1998-2002, 2004, 2005 Branden Robinson <branden@debian.org>.
# Copyright 2006 Eugene Konev <ejka@imfi.kspu.ru>
### BEGIN INIT INFO
# Provides: slim
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: xfs $named slapd
# Should-Stop: xfs $named slapd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop the SLiM daemon.
### END INIT INFO
test -z "$HEED_DEFAULT_DISPLAY_MANAGER" && HEED_DEFAULT_DISPLAY_MANAGER=true
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
DAEMON=/usr/bin/slim
PIDFILE=/var/run/slim.lock
SSD_START_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --startas $DAEMON -- -d"
SSD_STOP_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --retry TERM/5/TERM/5"
case $1 in
start)
if [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
[ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
[ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
echo "Not starting X display manager (slim); it is not the default display manager."
else
echo -n "Starting X display manager: slim"
start-stop-daemon --start --quiet $SSD_START_ARGS || echo -n " already running"
echo "."
fi
;;
stop)
echo -n "Stopping X display manager: slim"
if ! [ -f $PIDFILE ]; then
echo -n " not running ($PIDFILE not found)"
else
start-stop-daemon --stop --quiet $SSD_STOP_ARGS
SSD_RES=$?
if [ $SSD_RES -eq 1 ]; then
echo -n " not running"
fi
if [ $SSD_RES -eq 2 ]; then
echo -n " not responding to TERM signals"
else
if [ -f $PIDFILE ]; then
echo -n " (removing stale $PIDFILE)"
rm $PIDFILE
fi
fi
fi
echo "."
;;
restart)
$0 stop
sleep 2
$0 start
;;
force-reload)
/etc/init.d/slim restart
;;
*)
echo "Usage: /etc/init.d/slim {start|stop|restart|force-reload}"
exit 1
;;
esac
# End of file
i didn't notice that, thanks for the info.it can run as daemon, use lxdm -d, and have pid file default at /var/run/lxdm.pid
it have log file at /var/log/lxdm.log, but nothing write to it now
openSUSE use Xsession too, i tested before the code you posted here and no Xsession file was available, using new svn one i finally found, and i discover why it was not working any way.not run as consolekit session, is a bug, something should change. From Fedora 11, fedora use the Xsession to start consolekit session, will opensuse follow this? or we have to write diffrent code for different distribution?