.bash_profile not run when using graphical login

John dingo at coco2.arach.net.au
Tue Oct 5 21:24:10 UTC 2004


Ross Burton wrote:
> On Tue, 2004-10-05 at 00:29 +0200, Michael Brandtner wrote:
> 
>>Am Montag, den 04.10.2004, 17:07 +0100 schrieb Andy:
>>
>>
>>>So I'd like to know if other people think it would be a good idea for 
>>>..bash_profile to be run if you log in graphically and then open a 
>>>terminal windows.
>>
>>How about /etc/env.d?
>>Gentoo ist doing it this way and its nice.
Sheesh. Red Hat has been using /etc/profile.d for years. Probably 
Mandrake (which started as a clone of RHL) and SuSE (which also uses Red 
Hat's Package Mananger) does too.

Hang on, I'be got SuSE here....

Yep. Sure does.

> 
> 
> Debian Policy says packages should work with no environmental variables
> defined.  For the Java example, this is why there are /usr/bin/java
> (etc.) alternatives which JVMs register with.

This isn't Debian. Debian won't package firmware for wireless cards either.

I don't think, haven't checked, that that _is_ what Debian policy says - 
it's not what those who know have said. Practically nothing works that way.

PATH is an environment variable.
BASH can be configured with environment variables.

Besides, I think putting configuration files for the user to customise 
into /etc/profile.d is configuring with configuration files. I'm only a 
stoopid user but, and Debian doesn't listen to stoopid users. What do 
they know?

> 
> .bash_profile isn't run at gdm login as you are not logging into bash,
> but GDM.  Try putting sh code into ~/.gnomerc.
> 
> My home desktop (I believe) has common login envars set in ~/.profile,
> which is sourced from .gnomerc and .bash_login.

It seems to me that however programs are run, whether by a stoopid user 
at a console login, in a Gnome or KDE or other DTE, with the {at,batch} 
command ir via cron, the environment and results should be the same 
_unless_ the program itself is written to behave differently.

Scripts are, of course, programs.

That means the same standard environment variables, the same umask.

The fact that this isn't so was a source of great confusion to this 
stoopid user when he was starting out writing shell scripts some eons ago.


If I login at tty2 and then startx, the environment settins are 
different in ways they should not be from those that would exist if I 
logged in via GDM, KDM or XDM.


Is that sensible?






More information about the ubuntu-users mailing list