[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: KDM vs XDM



In a message dated 4/22/99 12:34:01 PM Central Daylight Time, 
bmorgan@greenville.edu writes:

> Thanks.  I am still kind of a newbie at this.  Words like "binary" and
>  "compile the kernel" and other threatening words like that, I've steered
>  clear of.  Could you help me know exactly what you mean when you say "save
>  your old xdm binary and put the new kdm in it's  place"?
>  
>  

Sure.  :)

First off, I just checked my laptop (where I run my slink box) and it turns 
out I went about it the long way and modified my scripts to recognize 
start-kdm as well as start-xdm.  So, let me give you both ways..

1) The easiest way, but probably not the best way, is to rename your binaries.

	cd /usr/X11R6/bin
	mv xdm xdm.orig
	ln -s kdm xdm

2) The other way is more involved, but probably closer to The Debian Way.  

	In /etc/X11/xdm, there is a file called xdm.options.  That is hamm's 
options file,
	basically.  If there's a line in it that reads "start-xdm", change it 
to 
	"no-start-xdm".  Then, add a line "start-kdm" below that.  (PS - You 
can
	turn off kdm by changing it to "no-start-kdm").  You can't have both 
on
	tho - the script I'm about to give you will complain.

	Then, "cd /etc/init.d" and "mv xdm xdm.orig".  This saves off your 
original
	start xdm script just in case you want it back.

	Now, still in the init.d dir, take the attached file and save it as 
"xdm".

Hope that helps.
Jay
#!/bin/sh
# /etc/init.d/xdm: start or stop the X display manager

set -e

START_XDM=
START_KDM=

if grep -s ^start-xdm /etc/X11/xdm/xdm.options; then
  START_XDM=yes
fi

if grep -s ^start-kdm /etc/X11/xdm/xdm.options; then
  START_KDM=yes
fi

if [ "$START_KDM" ]; then
  if [ "$START_XDM" ]; then
    echo "Unable to start both xdm and kdm!"
    exit 1
  fi
else
  if [ ! "$START_XDM" ]; then
    echo "Nothing to start!"
    exit 0
  fi
fi

PATH=/bin:/usr/bin:/sbin:/usr/sbin
XDMDAEMON=/usr/bin/X11/xdm
KDMDAEMON=/usr/bin/X11/kdm
PIDFILE=/var/run/xdm.pid

if [ $START_XDM ]; then
  test -x $XDMDAEMON || exit 0
fi

if [ $START_KDM ]; then
  test -x $KDMDAEMON || exit 0
fi

if grep -qs ^check-local-xserver /etc/X11/xdm/xdm.options; then
  if head -1 /etc/X11/Xserver 2> /dev/null | grep -q Xsun; then
    # the Xsun X servers do not use XF86Config
    CHECK_LOCAL_XSERVER=
  else
    CHECK_LOCAL_XSERVER=yes
  fi
fi

case "$1" in
  start)
    if [ "$CHECK_LOCAL_XSERVER" ]; then
      problem=yes
      echo -n "Checking for valid XFree86 server configuration..."
      if [ -e /etc/X11/XF86Config ]; then
        if [ -x /usr/sbin/parse-xf86config ]; then
          if parse-xf86config --quiet --nowarning --noadvisory /etc/X11/XF86Config; then
            problem=
          else
            echo "error in configuration file."
          fi
        else
          echo "unable to check."
        fi
      else
        echo "file not found."
      fi
      if [ "$problem" ]; then
        echo "Not starting X display manager."
        exit 1
      else
        echo "done."
      fi
    fi
    if [ "$START_XDM" ]; then
      echo -n "Starting X display manager: xdm"
      start-stop-daemon --start --quiet --pid $PIDFILE --exec $XDMDAEMON || echo -n " already running"
    else
      echo -n "Starting X display manager: kdm"
      start-stop-daemon --start --quiet --pid $PIDFILE --exec $KDMDAEMON || echo -n " already running"
    fi
    echo "."
  ;;

  restart)
    /etc/init.d/xdm stop
    /etc/init.d/xdm start
  ;;

  reload)
    echo -n "Reloading X display manager configuration..."
    if start-stop-daemon --stop --signal 1 --quiet --pid $PIDFILE; then
      echo "done."
    else
      if [ "$START_XDM" ]; then
        echo "xdm not running."
      else
        echo "kdm not running."
      fi
    fi
  ;;

  force-reload)
    /etc/init.d/xdm reload
  ;;

  stop)
    if [ "$START_XDM" ]; then
      echo -n "Stopping X display manager: xdm"
    else
      echo -n "Stopping X display manager: kdm"
    fi
    start-stop-daemon --stop --quiet --pid $PIDFILE || echo -n " not running"
    echo "."
  ;;

  *)
    echo "Usage: /etc/init.d/xdm {start|stop|restart|reload|force-reload}"
    exit 1
    ;;
esac

exit 0

Reply to: