#! /bin/sh # /etc/rc.d/rc.4 # # This file is executed by init(8) when the system is being # initialized for run level 4 (XDM) # # Version: @(#)/etc/rc.d/rc.4 2.00 02/17/93 # # Author: Fred N. van Kempen, # At least 47% rewritten by: Patrick J. Volkerding # # modified for colorized screen messages and local needs # modified to provide easier selection rather than force a linear usage source /etc/functions-colors PreferredDM="KDM" DMLocation="" echo # Tell the viewers what's going to happen... echo -e "${BOLDGREEN}Starting the X graphical environment...${COLOR_RESET}" if [ "$PreferredDM" = "" ] ; then # no preferred DM is specified echo echo -e "${BOLDRED}Oh, oh!${COLOR_RESET}" echo echo "No login manager was specified." echo -e "Edit the ${BOLDGREEN}PreferredDM${COLOR_RESET} variable in the ${BOLDGREEN}$0${COLOR_RESET} script.${COLOR_RESET}" sleep 5 else echo -e "Using the ${BOLDGREEN}$PreferredDM${COLOR_RESET} login and session manager." echo "" if [ "$PreferredDM" = "KDM" ] ; then # Use the KDE kdm login manager: if [ -x /opt/kde/bin/kdm ]; then # Sometimes KDM is stored here DMLocation="/opt/kde/bin/kdm" elif [ -x /usr/share/config/kdm ]; then # Sometimes KDM is stored here DMLocation="/usr/share/config/kdm" fi elif [ "$PreferredDM" = "GDM" ] ; then # Use the GNOME gdm login manager: if [ -x /usr/bin/gdm ]; then # Sometimes GDM is stored here DMLocation="/usr/bin/gdm" elif [ -x /usr/sbin/gdm ]; then # Sometimes GDM is stored here DMLocation="/usr/sbin/gdm" fi elif [ "$PreferredDM" = "XDM" ] ; then # Use the X xdm login manager: if [ -x /usr/X11R6/bin/xdm ]; then DMLocation="/usr/X11R6/bin/xdm" fi fi # location error if [ "$DMLocation" = "" ] ; then echo -e "${BOLDRED}Oh, oh!${COLOR_RESET}" echo echo -e "You don't have the ${BOLDGREEN}$PreferredDM${COLOR_RESET} login manager installed in an" echo "expected location. Booting into runlevel 4 is difficult" echo "without knowing the location." echo echo -e "Edit the ${BOLDGREEN}$0${COLOR_RESET} script to correct the problem." sleep 10 fi fi # script error if [ "$DMLocation" = "" ] || [ "$PreferredDM" = "" ] ; then echo echo -e "${BOLDWHITE}Standby${COLOR_RESET} to automatically toggle into ${BOLDGREEN}runlevel 3.${COLOR_RESET}" echo -e "After logging in, type ${BOLDGREEN}startx${COLOR_RESET} to start the X graphical environment." sleep 10 echo init 3 else exec $DMLocation -nodaemon fi # All done.