This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 72262 - .bashrc evaluated before /etc/profile.d/ in xterms
.bashrc evaluated before /etc/profile.d/ in xterms
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gnome-core (Show other bugs)
7.3
All Linux
medium Severity low
: ---
: ---
Assigned To: Havoc Pennington
Mike McLean
:
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2002-08-29 19:03:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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:
Always

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
preferences.
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
situations:

bash --login

  /etc/profile
  ...which in turn sources /etc/profile.d scripts
  ~/.bash_profile 
  ...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

bash

  ~/.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.