Bash Initialisation Files
solipsys.co.uk
solipsys.co.uk
Many things start your shell this way:
* the "login" command
e.g. logging on an a virtual console
* "su -"
* "sshd"
e.g. ssh <hostname>
* xterms, depending on the settings
e.g. the original xterm if you run "xterm -ls"
or you run "xterm" with "xterm*loginShell: true"
in your ".Xdefaults" or ".Xresources"
* some X initialization scripts,
e.g. when logging in to a "Default" session via gdm or kdm
(how exactly this works depends on your distribution
some explicitly source .profile instead)
With "bash" you can also manually create a login shell using "bash -l" or "bash --login". $ sudo -i
# tr \\0 \\n </proc/$$/cmdline
-bash
#[1]: http://cl.ly/If85
Gnome Terminal -> Edit -> Profile Preferences -> Title and Command -> Run command as a login shell (off by default)
XFCE Terminal -> Edit -> Preferences -> General -> Run command as a login shell (off by default)
As far as I can find, KDE Konsole doesn't support this option. It never starts login shells. See http://docs.kde.org/development/en/kde-baseapps/konsole/comm...
From comments in http://news.ycombinator.com/item?id=4369485 -
Linux behavior vs. OSX (or, differences between terminal emulators): http://news.ycombinator.com/item?id=4369732
Different behaviors when using ssh et al.: http://news.ycombinator.com/item?id=4369751
Now combine those issues with the chart and you end up with something that is, true- deterministic, but not really useful. In the end, most people end up just having the startup files boil down to the same thing by sourcing their preferred one. And in the end most people don't try to think to much about the login vs. interactive vs. batch vs. posix/sh - even when they should be.
systemctl dot
It shows the dependency graph of your unit files.http://www.bootchart.org/ is also quite interesting to understand the boot process better and profile it.
"Those who don't understand Unix are condemned to reinvent it, poorly."
http://www.gnu.org/software/bash/manual/bashref.html#Bash-St...
http://www.gnu.org/software/bash/manual/bashref.html#Interac...