[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash profile not working



Marc Wilson said:
> Debian's X doesn't source those files because it's NOT SUPPOSED TO.  Why
> would it?  Those are files related to shells.

Correct. X should not source shell profile files. Again, the correct fix
is to start the session manager with:

  exec -l $SHELL -c "$STARTUP"

This way the initial environment is *enhanced by the user's default shell*.

So correct -- X does not source shell profiles. X just makes sure that
when it's initialized the user's shell environment is also initialized.

> If you're using startx to launch X, then they're already read.  If you're
> using a display manager (xdm/gdm/kdm/wdm/whatever), then there's no shell
> running, so they shouldn't be read.

To properly initialize the shell *environment* a login shell must be
created when the user logs in. That's why it's called a "login shell". If
you do not do this it is necessary to manually source the shell profile.
Why would one NOT what to do this automatically?

> Simple, huh?  If it bothers you, set environment variables in ~/.xsession
> like normal people do.

No. ~/.xsession is not executed unless you select "Default System
Session". So you cannot do this and have a consistent environment while
switching between GNOME, KDE, or whatever. Does that seem "normal" to you?

> There's no correct "fix" because nothing is broken.

Please do not disparage a fix that only contributes positively -- to the
best of my knowledge the fix presented has no negative impact on any other
configuration. There are a large number Debian user's running X windows.
With Debian, shells launched from an X windows session ignore /etc/profile
and ~/.bash_profile. I don't know what the official reasoning is (I
suspect there is no official reasoning) but this behavior is clearly
unexpected as expressed by a few other people on this list.

Mike



Reply to: