Problem with bash login.
Ben Scott
dragonhawk at gmail.com
Fri Jul 14 16:35:01 EDT 2006
On 7/14/06, Steven W. Orr <steveo at syslang.net> wrote:
> This is really frustrating. I want to log into a linux box which is
> running gdm such that after I have logged in, any app that I start will be
> running in the environment that is normally established in my
> .bash_profile.
So source your .bash_profile file from your .xwhatever file, like I said.
> If I was to go and set a symlink from .bash_profile to .xsession it would be the same
> thing as creating a shell script that did a cd followed by an exit.
Er, no. It would be the same thing as running .bash_profile as the
script to set up your X session. Since I assume your .bash_profile
does not, in fact, set up an X session, I expect what would end up
happening is your regular bash environment would be configured, but
then immediately exit, since no window manager (or variation thereof)
was started.
If, on the other hand, you *source* your .bash_profile at the top of
your .xwhatever file, your bash environment will be included, and then
your regular window manager will start.
> The description below explains why linking .xsession to .bash_profile is a
> waste of time.
Er, yes, it would be a waste of time, but not for the reasons you think.
Let's say you're running fvwm.
init runs an initscript, which runs gdm. You log in via gdm. gdm
runs the .xwhatever file to start your X session. Your .xwhatever
file source's your .bash_profile file, thus getting your regular
environment. Your .xwhatever file then starts fvwm. It does not
background fvwm. fvwm inheirts its environment from the .xwhatever
file, just like all Unix processes inherit their parent's environment.
fvwm runs and lets you do things like start an xterm. Those xterm's
will inherit fvwm's environment, in turn. When done, you quit fvwm,
which allows the .xwhatever file to continue. It hits the end, so the
interpreter exits. That signals the end of your X session, and gdm
cleans things up.
(It is common to use "exec fvwm" to replace the .xwhatever
interpreter with the window manager, rather then having a useless
interpreter sitting around all the time. But the end result is the
same.)
Replace "fvwm" with "gnome-session", "startkde", "twm", or whatever
you prefer. :-)
I keep calling it .xwhatever because I can never keep all the
various X startup files straight. There's .xsession, .Xclients,
.xinitrc, and some others, depending on platform. I usually just end
up symlinking all the .xwhatever files together. :-)
Does that help?
-- Ben
More information about the gnhlug-discuss
mailing list