X sessions and login shells

Richard Downer rdowner at gmail.com
Sat Apr 16 21:02:05 UTC 2005


Hello all,

I've been playing around with command line shells in the last couple
of days - I still spend a lot of time at the command line so it's
worth spending a bit of time getting that environment perfect.  At the
moment I'm trying out zsh (which may or may not be relevant to this
problem.)

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?  If so, why?

As I mentioned I am using zsh (on hoary), but I vaguely remember bash
on warty giving me similar problems...

-- 
rd.




More information about the ubuntu-users mailing list