Gnome applications and .bash_profile

Steven W. Orr steveo at syslang.net
Mon Nov 2 05:32:09 UTC 2009


On 10/31/09 03:39, quoth Jonathan Ryshpan:
> It looks like environment variables set in .bash_profile are visible to
> applications started in gnome but not via a shell.  For example evolution
> knows when I modify LC_COLLATE.
> 
> But how?  Here's the invocation chain from login down to evolution -- no 
> shells here.

This is an old and stupid problem. When you log in you should have your
environment fully defined. The environment is basically all of your
environment variables. They should all be defined in exactly one place: Your
~/.bash_profile and nowhere else.

I run kde so I can't tell you what I would do to fix it. I log in and my
environment is defined because kde actually works.

If you log in using gdm and your environment is not defined then my advise is
not going to be pretty.

1. You can file a bug. I encourage this. It is broken behavior and should be
fixed.

Option B. Start debugging the problem. The idea is to start putting echo
statements in your /etc/profile and your ~/.bash_profile with the goal of
creating a new file in /etc/X11/xinit.d to see where you can source in your
/etc/profile followed by sourcing in your ~/.bash_profile. You should append
to a logfile in /tmp and make sure to delete the file before logging out.

echo "$(date): Hello from /etc/profile" >> /tmp/login

You might be able to say something simple in /etc/X11/xinit/xinitrc-common like

f=/etc/profile
[[ -f $f ]] && . $f
f=~/.bash_profile
[[ -f $f ]] && . $f

IT IS WRONG to set environment variables in your .bashrc unless you really
know what you're doing. Most people don't. IT IS WRONG to have to run a
terminal emulator program with the idea that it should be a login shell. ALL
PROGRAMS use the environment, not just terminal emulators. If you log in then
your environment should be defined.

I don't use gnome but I'm very surprised that this is still an issue.

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20091102/dea4b6b3/attachment-0001.sig>


More information about the fedora-list mailing list