Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 72262 - .bashrc evaluated before /etc/profile.d/ in xterms
.bashrc evaluated before /etc/profile.d/ in xterms
Product: Red Hat Linux
Classification: Retired
Component: gnome-core (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Havoc Pennington
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2002-08-22 11:31 EDT by Keith Howanitz
Modified: 2007-04-18 12:45 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-08-29 19:03:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Keith Howanitz 2002-08-22 11:31:06 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020408

Description of problem:
.bashrc is evaluated before the scripts in /etc/profile.d/ in all terms started
in gnome so that user defined aliases are overwritten.  i.e. placing the line
alias ls='ls -AF --color' in .bashrc is overwritten by /etc/profile.d/colorls.sh
with alias ls='ls --color=tty'.  Users should be able to modify ls by placing an
alias for ls in ~/.bashrc

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.modify ~/.bashrc
2.start gnome 
3.start a gnome term
4.enter ls

Actual Results:  ls resulted in ls --color=tty

Expected Results:  ls should have been aliased ls -AF --color

Additional info:
Comment 1 Bernhard Rosenkraenzer 2002-08-29 19:03:10 EDT
hp: How does gnome launch its shells?
This works just as intended in KDE...

Comment 2 Havoc Pennington 2002-08-29 19:17:27 EDT
works fine in gnome for me too, in rawhide.

In 7.3 if it doesn't work I'm not sure what's wrong... maybe 
you need to toggle the "--login" or "login shell" option in gnome-terminal
Comment 3 Mike McLean 2002-09-02 16:12:08 EDT
The .bashrc in /etc/skel sources /etc/bashrc, which in turn sources the scripts
in /etc/profile.d.  Is it possible that these lines are still in your .bashrc
and occur after your modifications?

Experimenting with strace reveals the following order of access in various

bash --login

  ...which in turn sources /etc/profile.d scripts
  ...which in turn sources ~/.bashrc
     ...which in turn sources /etc/bashrc
        ...which in turn sources /etc/profile.d scripts again

  yes, only /etc/profile and ~/.bash_profile are sourced directly in this case.
If you remove this line from .bash_profile, ~/.bashrc (and hence /etc/bashrc)
will not be sourced in this case.

bash -norc

  none of these files are sourced


  ~/.bashrc is sourced
  ...which in turn sources /etc/bashrc
     ...which in turn sources the /etc/profile scripts

In *all* of these cases, user controlled config files have the final say.

Note You need to log in before you can comment on or make changes to this bug.