unterschied xterm/konsole "normale" konsole

Sven Bröckling sven at broeckling.de
Fri Jun 4 15:00:09 CEST 2004


Hi Hauke,

> der tip mit der option --ls war schon gut. danke dafür. was ich nun aber
> weiter nicht verstehe ist, was das für ne shell ist, die ohne --ls   
> option
> aufgerufen wird. ist eine nicht login shell. das ist klar. aber mein  
> stant
> ist, dass eine login shell eine shell ist wo ich mich anmelde? wie am
> terminal (alt-f1)? wenn ich nun aber eine shell unter kde aufrufe ist  
> das ja
> keine login shell? ich meine ich muss mich nicht einloggen? oder habe  
> ich da
> ein grundsätzliches verständnisproblem?
Naja, ein Blick auf ps hilft da auch erstmal weiter :

Shell über die erste Virtuelle console

root      1754  0.0  0.1  1508  568 vc/1     S    07:55   0:00  
/sbin/agetty 38400 tty1 linux
root      1755  0.0  0.1  2288  988 ?        S    07:55   0:00 login --  
root
root      1764  0.0  0.2  2288 1240 vc/2     S    13:52   0:00  \_ -bash


Shell über "konsole"

sbroeck   2596  0.5  0.7 26336 15772 ?       S    14:51   0:00  \_  
kdeinit: konsole
sbroeck   2617  0.0  0.0  4384 1400 pts/4    S    14:51   0:00      \_  
bash -l
sbroeck   3823  0.0  0.0  2552  868 pts/4    R    14:53   0:00          \_  
ps auxfw


Letztendlich wird die bash gestartet, die Frage ist nur woher,
und mit welcher Option. Bash wertet den Parameter -l aus, und
verhält sich dann als Login-Shell (man bash, es werden ein paar
mehr Dateien ausgewertet, darunter .profile). Wenn du Ctrl-Alt-F1
drückst, siehst du den Prompt des "login" Programmes /bin/login,
dass dich zum Eingeben des Benutzernamens auffordert. Dieses
wird wiederrum von einem getty-Programm gestartet, welches in
der /etc/inittab verankert ist :


c1:12345:respawn:/sbin/agetty 38400 tty1 linux


Gibst du deinen Benutzernamen und das Passwort richtig ein,
startet login die Shell. (KDE-)Konsole startet auch eine
Shell.

Der Unterschied Loginshell / Shell liegt einfach darin :
(man bash)

When bash is invoked as an interactive login shell, or
as a non-interactive shell with the --login option, it
first reads and executes commands from the file /etc/profile,
if that file exists. After reading that file, it looks for ~/.bash_profile,
~/.bash_login, and ~/.profile, in that order, and reads
and executes commands from the first one that exists and is
readable. The --noprofile option may be used when the shell
is started to inhibit this behavior.

Ergo werden bei einer Loginshell /etc/profile und danach die
Benutzerbezogenen Dateien ausgeführt.

Gruss
   Sven



More information about the Linux mailing list