Book HomeLearning UnixSearch this book

2.9. Quitting

Like almost everything in X, the way to quit X is configurable. The key to shutting down X is to know which of your programs (your windows or window manager) is the controlling program. When the controlling program quits, any leftover X programs are killed immediately. The controlling program is usually either the window manager or the single terminal window that started your X session.

Find the controlling program for your X session and write it down:

_____________________________ Program to quit last

If your controlling program is a terminal window, we suggest leaving that window minimized from just after you've logged in until you've shut down all the other X programs. That way, you won't end your X session accidentally by closing that terminal window too soon.

No matter what your controlling program is, closing it sooner than last means the other windows will be killed quickly and automatically. There's a chance, though, that programs running in those killed windows--especially if they're terminal windows--won't be killed, and will keep running, disconnected from your login session. So it's best to close the controlling program window last.

To quit the window manager, select the "Exit" or "Quit" command on its main menu.

Here are the steps to shut down X:

  1. Quit all noncontrolling programs (all programs other than the controlling program). If any windows are running programs that have their own "quit" commands, it's a good idea to use those special commands to quit. For example, if you're running a text editor in a terminal window, use the editor's "quit" command, then close the terminal window by entering exit at the shell prompt. (Most terminal windows will close when their shell program exits. If yours doesn't do this, though, you'll need to finish by using the terminal window's own "close" command.)

    Using the program's own "quit" command gives the program time to clean up and shut down gracefully. On the other hand, the Close item on a menu from the window manager can interrupt and kill a program before it's ready. If, however, a program doesn't have its own "quit" command, use Close on the window menu.

    If any minimized windows are running programs that have their own "quit" commands, restore those windows and use the "quit" command.

  2. Quit the controlling program.

    After X shuts down, you may get a Unix shell prompt. If you do, you can log out by entering exit. If you simply get another login box from xdm (as in Figure 2-2A), you're done.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.