System Administration Terminals and the X Window System
Terminals: Then and Now "In the old days": real serial terminals Common now: "Virtual Terminal" on monitor In both cases, a tty "TeleTYpe" a text terminal
Terminal Types vt100 ansi each uses different 'control sequences' to do things like erase characters, move the cursor around, etc
Termcap termcap: TERMinal CAPabilities database: an generic interface to different terminal types allows programs to say "move cursor here" and translates that into the actual control sequences the end terminal requires contains information about screen size, color capability, etc.
How terminals are started From inittab: mingetty runs to listen on a virtual terminal, displays login prompt: 1:2345:respawn:/sbin/mingetty tty1 Type in username, that is sent to login program login prompts for password, verifies that password, finds the user's default shell, and executes that User now has shell
How terminals are started When user exits shell, login exits and then mingetty exits Init respawns mingetty, starting the process over again
X Window System X is a framework for a graphical user interfaces, developed initially at MIT. A common implementation on Linux systems, is XFree86, an open source implementation of the X Window System A newer implemenation is the X.org implementation this is what Red Hat EL 4 and 5 use
Starting X startx XDM and variants
Startx startx is used for manually starting X11. It is typically run when your machine doesn't default to starting with X11 on. It is also useful when configuring X you can configure X, run startx to try it, and make changes as necessary
XDM and Variants xdm (the X Display Manager) and related programs (kdm, gdm, the KDE and Gnome versions, respectively, of xdm) start X and provide a graphical login screen. This is what starts up when you start Red Hat Enterprise Linux in runlevel 5
Which display manager will run? /etc/sysconfig/desktop contains prefered display manager DISPLAYMANAGER= XDM If that line does not exist, it simply defaults to a particular display manager (currently, gdm)
Window Managers X simply provides a protocol for drawing simple objects: lines, boxes, circles, etc. It has no concept of the menus, title bars, tool bars, etc., that we expect in a graphical user environment Window Managers offer an interface between X and programs, offering those common items and allowing for a common look
Window Managers Some display managers offer more, and are called "Desktop Environments", which provide higher level things like file managers, interprogram communications, etc.
KDE The K Desktop Environment, a project of the KDE e.v., a German non profit foundation
Gnome The desktop environment of the GNOME project, part of the GNU project of the Free Software Foundation
Which Window Manager runs? Depends on which display manager you run. gdm and kdm both offer popup menus that allow you to change the which window manager opens
prefdm (RHEL5) /etc/x11/prefdm is called by init when starting a graphical runlevel Prefdm takes the information in /etc/sysconfig/desktop (if it exists) and runs the appropriate display manager If X stops for some reason, init will respawn prefdm
Xsession (RHEL4) /etc/x11/xdm/xsession is called by all three window managers to start the 'Default' window manager. This file looks in $HOME/.xsession $HOME/.Xclients If those files exist, they are executed.
Xsession So you could start gnome session or startkde, which start the default gnome or kde window managers: exec gnome-session exec startkde or even something more arcane exec twm
/etc/sysconfig/desktop If neither of those files exist, it looks in /etc/sysconfig/desktop for a line that looks like DESKTOP=GNOME DESKTOP=KDE which in turn starts gnome session or startkde
Configuring X Configuration for XFree86 is in the /etc/x11/xorg.conf file, which is a wonderfully long and complicated file. The X Window System is a very flexible system, allowing for heavy customization of nearly every aspect of the system. With that flexibility comes a lot of complexity.
Configuring X Fortunately, you typically configure X at installation time If you have to reconfigure afterwards, you can run /usr/bin/system-config-display which does a decent job of detecting cards and monitors and fixing things More complicated setups are left as an exercise to the reader