Runlevel 3: xdm

Steven R. Robertson srobert at anv.net
Fri Jun 30 11:39:13 PDT 2000


 Hello,
  I don't think this was discussed in the book yet. (I'm working from
lfs-2.3.3). I wanted to set up
runlevel 3 to boot up with xdm. Here's the technique I used which seems
to work, but I'm sure you can improve on it. The following assumes that
you have a working xdm, that you can start as root.

  1. Make the same symlinks in /etc/rc3.d to scripts in /etc/init.d that
you currently have in /etc/rc2.d. For example, if you have a
/etc/rc2.d/S03sysklogd then do this:
          cd /etc/rc3.d
           ln -s ../init.d/sysklogd S03sysklogd
Similarly, create links for any other scripts, that you have in
/etc/rc2.d, in /etc/rc3.d.

  2. Create the following script in /etc/init.d (and name it xdm).

     #!/bin/sh
     # Begin /etc/init.d/xdm
     check_status()
     {
     if [ $? = 0 ]
     then
       echo "OK"
     else
       echo "FAILED"
     fi
     }
     case "$1" in
       start)
         echo "Starting xdm..."
         start-stop-daemon -S -q -o -x usr/X11R6/bin/xdm
         check_status
         ;;
       stop)
         echo "Stopping xdm..."
         start-stop-daemon -K -q -o -p
     /usr/X11R6/lib/X11/xdm/xdm.pid
         rm /tmp/.X0-lock
         check_status
         ;;
       reload)
         echo -n "Reloading xdm..."
         start-stop-daemon -K -q -o -s 1 -p
     /usr/X11R6/lib/X11/xdm/xdm.pid
         rm /tmp/.X0-lock
         check_status
         ;;
       restart)
         echo -n "Stopping xdm..."
         start-stop-daemon -K -q -o -p
     /usr/X11R6/lib/X11/xdm/xdm.pid
         rm /tmp/.X0-lock
         check_status

       sleep 1

         echo -n "Starting xdm..."
         start-stop-daemon -S -q -o -x usr/X11R6/bin/xdm
         check_status
         ;;
       *)
         echo "Usage: $0 {start|stop|reload|restart}"
         exit 1
         ;;
         esac
         # End /etc/init.d/xdm

(This was patterned after sysklogd and similar scripts. Notice, I also
had to include a
 'rm /tmp/.X0-lock' in a few places to get it to work. Possibly .X*-lock
would work better
   for some systems.)

  3. Make a symlink in /etc/rc3.d to /etc/init.d/xdm by using the
following commands.
           cd /etc/rc3.d
           ln -s ../init.d/xdm S49xdm

   (If you don't call it S49xdm you probably want to use a large number,
so that this is one of the
   last scripts to execute when you boot up. Perhaps S99xdm would be
better?)

  4. Make symlinks in /etc/rc0.d and /etc/rc6.d as follows.
           cd /etc/rc0.d
           ln -s ../init.d/xdm K10xdm
          cd /etc/rc6.d
           ln -s ../init.d/xdm K10xdm

   (Here you want a small number I used K10 so that killing xdm is the
first thing that happens on
    reboot. I think that the location for these links is right isn't
it?)

   5.  Change the line in /etc/inittab that reads:
                    id:2:initdefault:
        to read:
                    id:3:initdefault:

   6. Now reboot. You should get a running xdm.

I hope I didn't leave anything out. :-)


Steve Robertson
srobert at anv.net

--
Mail archive: http://www.pcrdallas.com/mail-archives/lfs-discuss
IRC access: server: irc.linuxfromscratch.org port: 6667 channel: #LFS
Unsubscribe: email lfs-discuss-request at linuxfromscratch.org and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)



More information about the lfs-dev mailing list