Linux Runlevel 3

When in runlevel 3, the best way to start an X session is to log in and type startx. The startx
command is a front-end to the xinit command which launches the XFree86 server and connects X clients applications to it. Because the user is already logged into the system at runlevel 3, startx does not launch a display manager or authenticate users. Refer to Section 7.5.2 Runlevel 5 for more information about display managers.
When the startx command is executed, it searches for a .xinitrc le in the user's home directory
to dene the desktop environment and possibly other X client applications to run. If no .xinitrc le
is present, it will use the system default /etc/X11/xinit/xinitrc le instead.
The default xinitrc script then looks for user-dened les and default system les, including .Xresources,
.Xmodmap, and .Xkbmap in the user's home directory and Xresources, Xmodmap, and
Xkbmap in the /etc/X11/ directory. The Xmodmap and Xkbmap les, if they exist, are used by the xmodmap utility to congure the keyboard. The Xresources les are read to assign specic preference values to applications.
After setting these options, the xinitrc script executes all scripts located in the
/etc/X11/xinit/xinitrc.d/ directory. One important script in this directory is xinput, which
congures settings such as the default language.
Next, the xinitrc script tries to execute .Xclients in the user's home directory and turns to
/etc/X11/xinit/Xclients if it cannot be found. The purpose of the Xclients le is to start
the desktop environment or, possibly, just a basic window manager. The .Xclients script in the
user's home directory starts the user-specied desktop environment in the .Xclients-default le.
If .Xclients does not exist in the user's home directory, the standard /etc/X11/init/Xclients
script attempts to start another desktop environment, trying GNOME rst and then KDE followed by twm. The user is returned to a text mode user session after logging out of X from runlevel 3.