5 kx #! /bin/sh
5 kx #
5 kx # rc.4 This file is executed by init(8) when the system is being
5 kx # initialized for run level 4 (XDM)
5 kx #
5 kx # Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
5 kx # Modifyed by: Patrick J. Volkerding, <volkerdi@slackware.com>,
406 kx # Andrey V. Kosteltsev, <kx@radix-linux.su>
5 kx #
5 kx
5 kx # Tell the viewers what's going to happen...
5 kx echo "Starting up X11 session manager..."
5 kx
5 kx # If you'd like to start something different or in a different order than
5 kx # the options below, create your own startup script /etc/rc.d/rc.4.local
5 kx # and make it executable and it will be used instead:
5 kx if [ -x /etc/rc.d/rc.4.local ]; then
5 kx exec /bin/bash /etc/rc.d/rc.4.local
5 kx fi
5 kx
385 kx # Try to use lightdm session manager:
385 kx if [ -x /usr/bin/lightdm ]; then
385 kx #
385 kx # Disable to create /.cache directory by root:
385 kx #
385 kx mkdir -p /var/lib/lightdm/.cache
385 kx chown -R lightdm:lightdm /var/lib/lightdm
385 kx
385 kx PATH="/usr/bin:/bin"
385 kx HOME=/var/lib/lightdm
385 kx
385 kx export PATH HOME
385 kx
385 kx exec /usr/bin/lightdm
385 kx fi
385 kx
5 kx # Try to use GNOME's gdm session manager. This comes first because if gdm is on the
5 kx # machine then the user probably installed it and wants to use it by default:
5 kx if [ -x /usr/bin/gdm ]; then
5 kx exec /usr/bin/gdm -nodaemon
5 kx fi
5 kx
5 kx # Someone thought that gdm looked prettier in /usr/sbin, so look there, too:
5 kx if [ -x /usr/sbin/gdm ]; then
5 kx exec /usr/sbin/gdm -nodaemon
5 kx fi
5 kx
5 kx # Not there? OK, try to use KDE's kdm session manager:
5 kx if [ -x /opt/kde/bin/kdm ]; then
5 kx exec /opt/kde/bin/kdm -nodaemon
5 kx elif [ -x /usr/bin/kdm ]; then
5 kx exec /usr/bin/kdm -nodaemon
5 kx fi
5 kx
5 kx # Look for SDDM as well:
5 kx if [ -x /usr/bin/sddm ]; then
5 kx exec /usr/bin/sddm
5 kx fi
5 kx
5 kx # If all you have is XDM, I guess it will have to do:
5 kx if [ -x /usr/bin/xdm ]; then
5 kx exec /usr/bin/xdm -nodaemon
5 kx elif [ -x /usr/X11R6/bin/xdm ]; then
5 kx exec /usr/X11R6/bin/xdm -nodaemon
5 kx fi
5 kx
5 kx # error
5 kx echo ""
5 kx echo "Hey, you don't have GDM, KDM, SDDM or XDM. Can't use runlevel 4 without"
5 kx echo "one of those installed."
5 kx echo ""
5 kx sleep 30
5 kx
5 kx # All done.