Bug 111483

Summary: /etc/profile.d scripts run by /etc/bashrc
Product: [Fedora] Fedora Reporter: Reuben Thomas <rrt>
Component: setupAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: mitr, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-23 05:07:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Reuben Thomas 2003-12-04 12:11:16 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; Linux i686; U) Opera 7.23  [en]

Description of problem:
Actually, this is more in the way of a question than a bug report 
(though I do consider the behaviour undesirable). Having googled 
extensively and checked the RedHat manuals, I can find no mention of 
why /etc/bashrc runs the scripts in /etc/profile.d (in the case that 
they haven't already been run by /etc/profile).

I noticed this because of a 3rd party /etc/profile.d script that 
added something to an environment variable. Of course, every time a 
subshell is spawned, this causes the variable to be expanded, which 
is undesirable. I filed a bug report with patch to the maintainer of 
the RPM in question, but it still seems reasonable to wonder why 
something called "profile", which one expects, by analogy with .
profile, /etc/profile and .bash_profile to be run only in login 
shells, is being run in all shells.

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

How reproducible:
Always

Steps to Reproduce:
1. Start bash, not as a login shell.

    

Actual Results:  The /etc/profile.d scripts are run.

Expected Results:  I would've expected them to be run only in a login 
shell.

Additional info:

Comment 1 Bill Nottingham 2003-12-04 16:51:38 UTC
It's a really really old change. ISTR it was done for uniformity of
all interactive shells, for example, xterms, etc.

Comment 2 Reuben Thomas 2003-12-06 21:51:30 UTC
Since you've not closed the bug, I'm guessing you at least admit the 
possibility that it might be a problem?

Just as a suggestion, here's my view on what should happen: because 
/etc/profile and .bash_profile aren't run in every xterm either 
(unless you use the -ls option) I've either set a default of -ls, or 
caused my environment to be set up by .Xclients or somewhere else in 
the login process (at the moment I don't use xdm, kdm or whatever, so 
it's simply a question of logging in and running startx; all my X 
clients therefore inherit my login environment).

Some solution like this is cleaner as it doesn't break assumptions 
about the function of profile.d scripts, while still giving the 
expected effect in xterms (not to mention other applications started 
directly by the window manager).

Comment 3 Bill Nottingham 2004-09-23 05:07:21 UTC
At this point, I don't think we're going to change this.