Recipe 7.4. Starting and Stopping X

 < Day Day Up > 

7.4.1 Problem

You don't like the idea of changing runlevels just to kill an X session. After all, it means restarting all services, and it will mess up any users who are logged in. What's a better way to stop an X session?

7.4.2 Solution

There are several choices. The best way is to configure one runlevel to boot to a text console. Then start X when you want it with the startx command:

$ startx

Then you can exit X simply by logging out of the X session. You won't be logged out of Linux, just X.

On most distributions, runlevel 3 boots to a text console. On Red Hat, Fedora, Mandrake, and SuSE, runlevel 5 is a graphical login manager. On Slackware, this is runlevel 4.

Debian users may have to take some extra steps, as Debian's default 2-5 runlevels are all the same. See Recipe Recipe 7.6 to learn how to customize Debian's runlevels.

7.4.3 Discussion

There are other ways to stop an X session. These are better suited for when X locks up.

Any user can use "xkill", by typing Ctrl-Alt-Backspace.

If you're running a graphical login manager (xdm, kdm, or gdm), root can stop the login manager. This also logs out users:

# /etc/init.d/gdm stop

7.4.4 See Also

  • The "Introduction" to this chapter

  • Recipe 7.3

  • Recipe 7.6

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net