Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 63510 - .bashrc and /etc/rc.conf variables and settings not correctly initialized by /etc/profile
Summary: .bashrc and /etc/rc.conf variables and settings not correctly initialized by ...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-09 22:29 UTC by Arlo
Modified: 2004-09-10 19:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arlo 2004-09-09 22:29:20 UTC
This started with trying to change my EDITOR variable.
In /etc/rc.conf I set the variable to /usr/bin/xemacs
I opened a new xterm and the variable was still set to /usr/bin/emacs (the old setting).

I tried to manually source /etc/profile but it still didn't update the variable.  I then checked /etc/profile and noticed that EDITOR is only set from /etc/rc.conf if it is currently blank.  I do not set EDITOR in .bashrc or .bash_profile, nor is it set under /etc/env.d or anywhere else I can think of.  

Well, after a reboot, /usr/bin/xemacs wan initialized correctly.  However, I was able to determine that it is still being set before /etc/profile can set it frome /etc/rc.conf.

Another issue I found was that settings in root's ~/.bashrc are not effective.  I added a few aliases and non of them function.
And yes I'm doing a su -  and I've done a source /etc/profile.

Also, with the regular user, changing an alias in .bashrc would not be initialized by source /etc/profile.  When I opened a new xterm the alias would then work.

Reproducible: Always
Steps to Reproduce:
rc.conf problem:
1. set EDITOR
2. source /etc/profile
3. EDITOR still old setting
4. Reboot
5. EDITOR is now new setting

User .bashrc
1. Add alias
2. source /etc/profile
3. alias not functional
4. open new xterm
5. alias functional

root .bashrc
1. add alias
2. su -; source /etc/profile
3. alias not functional
4. logging into a regular terminal instead of xterm doesn't have alias functionality either
Comment 1 SpanKY gentoo-dev 2004-09-09 22:47:25 UTC
when you launched a new xterm it probably took $EDITOR from your active environment which means it ignored the new setting ...

as for ~/.bashrc, it's probably because `su -` invoked a new login shell which means ~/.bash_login would have been read and not ~/.bashrc ---> not a bug
Comment 2 Arlo 2004-09-10 19:35:21 UTC
The previous comment was correct.  I misunderstood the role of /etc/profile in all of this.  Using .bash_login fixes my root problem and I guess EDITOR is set only once by the xdm.  Thanks for the clarification.