Login

This article Article description::is a primer which explains various aspects of a login [[shell.]]

Login shell in Gentoo
The most important job of a login shell in Gentoo is to set system-wide environment variables. This is done
 * for Bash and variants, by reading, and
 * for csh/tcsh, by reading.

See below for the details.

This section describes Gentoo specific matters of login shells. For login shells general in Unix, see the pointer(s) in.

Default: Bash and variants
For Bash and variants, a login shell runs special configuration file(s), e.g. (and others) for bash. In Gentoo, it reads (= sources) other system-wide configuration files. These configuration files set environment variables, and do some other setups. These settings will be inherited by other shells, say opened in terminal emulators.

Load order of system-wide config files for Bash
A (bash) login shell reads:


 * first.
 * It then reads (sources), and
 * files.

If the shell is bash, is also sourced. This does not configure Gentoo itself; it rather provides the Gentoo-default of bash look-and-feel.

System wide config files for Bash explained

 * Provided by (or alternatives). Other than reading other files, this file doesn't do many jobs.
 * Provided by (or alternatives). Other than reading other files, this file doesn't do many jobs.


 * This file sets environment variables. Some packages require environment variables to be set, and in Gentoo, such environment variables are collected here.
 * This file is generated from files . These files are installed by some packages (or created by config tools like eselect). For example is provided by.
 * This file is usually automatically updated. You can also manually update it by calling.
 * For the details of how is generated, see Handbook -> Environment variables -> section "Defining variables globally".
 * For the details of how is generated, see Handbook -> Environment variables -> section "Defining variables globally".


 * Some packages install files here, to be sourced by the login shell, to provide per-package configurations . It is a Unix custom, and part of the Linux Standard Base, 5.0 (2015).
 * Some packages install files here, to be sourced by the login shell, to provide per-package configurations . It is a Unix custom, and part of the Linux Standard Base, 5.0 (2015).

When these files are updated, typically, you have to re-read them again from your shell(s), for your shell to function correctly.

Tcsh
If tcsh is run as a login shell, it reads one system-wide configuration file. It reads (= sources) other system-wide configuration files. These configuration files set environment variables, and do some other setups. These settings will be inherited by other shells, say opened in terminal emulators.

A login shell of tcsh also reads. It provides tcsh-specific default behavior, and does not configure Gentoo itself.

Load order of system-wide config files for tcsh
A tcsh login shell reads:


 * first.
 * It then reads (sources) ,
 * and files.

System wide config files for tcsh explained

 * Provided by . (This file is distributed by Gentoo, not by the tcsh upstream.)
 * Provided by . (This file is distributed by Gentoo, not by the tcsh upstream.)


 * This file corresponds to for bash, explained above. This file is also maintained by , even if any csh-variants is not installed.
 * This file corresponds to for bash, explained above. This file is also maintained by , even if any csh-variants is not installed.


 * Similar to for bash explained above, but there is no standard for.
 * Similar to for bash explained above, but there is no standard for.

If these files are updated, typically, you have to re-read them again from your shell(s), for your shell to function correctly.

Fish
As stated in the article fish, fish can't load system-wide configuration files mentioned above.