X sessions and login shells

Marius Gedminas marius at pov.lt
Mon Apr 18 13:35:27 UTC 2005


On Sat, Apr 16, 2005 at 10:02:05PM +0100, Richard Downer wrote:
> With shells there is a distinction between the "login shell" and other
> shells - one difference being that a login shell will execute
> 'profile' scripts.  For bash, as I remember, these are /etc/profile
> and ~/.bash_profile.  zsh has equivalents with different names.  These
> profiles are for setting global environment variables - I'm using
> these to set EDITOR and JAVA_HOME variables.
> 
> Now when I log in at a text console, EDITOR and JAVA_HOME are set, as
> expected.  But, when I log in at the X graphical screen, EDITOR and
> JAVA_HOME are *not* set - which suggests that although I'm "logging
> in" at no point is a login shell invoked and the profiles run.
> 
> Am I right - logging in through X does not invoke a login shell and
> does not load profiles?

Yes.

> If so, why?

That's just the way it is.

You can create a ~/.gnomerc file and put the definitions of important
environment variables there:

  export PATH=~/bin:$PATH
  ...

Marius Gedminas
-- 
This message has been ROT-13 encrypted twice for higher security.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050418/eb605c66/attachment.sig>


More information about the ubuntu-users mailing list