Problem with bash login.
Ben Scott
dragonhawk at gmail.com
Fri Jul 14 13:36:01 EDT 2006
On 7/14/06, Steven W. Orr <steveo at syslang.net> wrote:
> I used to view myself as one of the top authorities on bash issues.
This isn't really a bash issue, per se...
> How in the Wide Wide World Of Sports do I get my .bash_profile to execute
> when I log in using gdm.
Do you mean for shell's started in an xterm, or for *all* programs
that get run from X (assuming there is a difference for you)?
Shell's started in an xterm are non-login shells by default. That
means .bashrc is run, but .bash_profile is not. There's a couple ways
to address this. One is to add the "-ls" (I think that's it, check
the man page) switch to xterm, which asks for a login shell. Another
approach is to put everything you want in one file, and have both
.bashrc and .bash_profile source that file. (Or have one of them
source the other.)
Now, maybe you want *all* X programs to get your .bash_profile
environment. That's probabbly the Right Thing anyway. Now, until
you start an xterm, there's nominally not going to be a bash instance
running at all. Having gdm fire off a shell isn't going to do
anything useful, because nothing else will inherit the environment
from that shell.
What you need to do is put whatever environment you want in your
.xinitrc/.Xclients/.Xsession/whatever file. Or, more likely, put it
all in a separate file, and source that from both .bash_profile and
.xwhatever. The .xwhatever file is what gdm runs when you login.
It's job is to start your window manager (or session manager, or
desktop environment, or whatever). It is often a shell script itself.
If you don't have an .xwhatever file, look under the /etc/X11/ tree
to find the system's version of it, copy that to your home directory,
and modify.
Hope this helps,
-- Ben
More information about the gnhlug-discuss
mailing list