Bug 72262 - .bashrc evaluated before /etc/profile.d/ in xterms
Summary: .bashrc evaluated before /etc/profile.d/ in xterms
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gnome-core
Version: 7.3
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-22 15:31 UTC by Keith Howanitz
Modified: 2007-04-18 16:45 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-08-29 23:03:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Keith Howanitz 2002-08-22 15:31:06 UTC
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 23:03:10 UTC
hp: How does gnome launch its shells?
This works just as intended in KDE...



Comment 2 Havoc Pennington 2002-08-29 23:17:27 UTC
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 20:12:08 UTC
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.