Quote:
Originally Posted by charging-ibis
So what your saying is that even though it is a GUI login screen the login shell is running in the background correct?
|
Well, sort of (and this might be a little more complicated than you're interested in but here goes anyway).
Shell programs -- BASH, Bourne, C, Korn (and others) -- are command interpreters; they're the interface between you on a console or terminal emulator (like an X Terminal) and the operating system. They're not running until you log in. You type a command at a shell program prompt and the shell "forks and exec's" that program. You can create shell programs that perform useful work incorporating such concepts as
if-else if-else,
for,
while and other constructs -- a shell program is a programming language like any other.
Logging in is a different concept and not necessarily related to any of the shells. There are three programs,
init,
getty and
login, used for that purpose.
The
init program "is the parent of all processes. Its primary role is to create processes from a script stored in the file
/etc/inittab. This file usually has entries which cause
init to spawn
gettys on each line that users can log in. It also controls autonomous processes required by any particular system." (from the manual page).
In
/etc/inittab, there is a default run level defined. On my system it is run level 3 which stops at a full-screen console (no GUI). On your system, it will probably be run level 4 (possibly some other run level but not 0, 1, or 6 which are 0 = halt the system and shut off the power, 1 = single user mode, 6 = reboot). The entry in
/etc/inittab will look something like this:
Code:
# Default runlevel. (Do not set to 0 or 6)
id:3:initdefault:
Now, the different run levels cause
init to execute different directives (found in
/etc/inittab), most notably for our purposes, the directive for run level 4. Run level 4 will attempt to start
gdm,
kdm or
xdm (maybe one or two others). If you're going to fiddle with it, make sure you write down what the run level was before you change it.
The
gdm program, I'm pretty sure, is for GNOME (don't have GNOME on my system, don't know),
kdm is for KDE and
xdm is if you don't have either of those. Only one of those will get started and it will handle the functions of
getty and
login.
So what does
getty do? If you set your default run level to 3 (you can do that, just edit
/etc/inittab and log out). Run level 3 takes you to a console,
getty opens a port, prints a login prompt and initiates a
login process (you enter your user and password). If you type correctly, you get logged in and are prompted to enter commands until you exit (type Ctrl-D or the word
exit) which takes you back to the
login prompt (yeah, it's the
login program).
You can, of course, star X running: simply enter
at a system prompt and,
viola! GNOME, KDE, Xfce or whatever starts and will run until you log out and you'll be back to the console (from which you can log out and log in as another user, log in as root or use
su - or use
sudo) and shut down the system with
shutdown or
init 0).
You can always edit
/etc/inittab and set the default run level back to 4.
Bottom line, nope, it's not a shell, it's a display manager (that might actually invoke a shell for the login and password but probably not).
You may want to look at the manual pages for
init,
getty,
login and
gdm,
kdm or
xdm (
xdm is a manual page,
gdm and
kdm are probably
info pages).
Hope this helps some.