Red Hat Bugzilla – Bug 102825
tcsh(1) sources /etc/profile.d/*.csh from the wrong file
Last modified: 2007-04-18 12:57:02 EDT
Description of problem:
csh(1) sources /etc/profile.d/*.csh from /etc/csh.cshrc, which is read by
every shell invoked. profile.d contents should be sourced from /etc/csh.login
instead (i.e., only for login shells). This would match current behaviour
of bash(1), since /etc/profile.d/*.sh is sourced from /etc/profile .
Version-Release number of selected component (if applicable):
Additional investigation turned up /etc/bashrc, which is not a standard
bash-related file, but sourced from /etc/skel/.bashrc, and therefore
from the individual user's ~/.bashrc. There is indeed the snippet to
source /etc/profile.d/*.sh scripts in /etc/bashrc, so in a rather ugly
but existing way, profile.d parts get sourced for *every* shell
NOTE to maintainer: bash 3.0 changes behaviour and sources
/etc/bash.bashrc for non-login interactive shells, so you can get rid
of this construct relying on user's .bashrc including the hook.
Tim, comment #1 might interest you.
I can't find any reference to /etc/bash.bashrc in the documentation or
chihiro:/tmp% wget -q http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz
chihiro:/tmp% md5sum bash-3.0.tar.gz
chihiro:/tmp% tar zxf bash-3.0.tar.gz
chihiro:/tmp% grep -r bash.bashrc bash-3.0
bash-3.0/config-top.h:/* #define SYS_BASHRC "/etc/bash.bashrc" */
(It's commented out)
I think I must be missing the point -- how can we make use of this?
Probably the /etc/bashrc owner should be cc'd.
Yep, missed that. Sorry.
I read the manual on a Debian system which has /etc/bash.bashrc support
enabled (filed appropriate bug to document this change in the Debian
However, the point is that it is there in the source for a reason,
even if it's uncommented. I suggest using the opportunity to clean
up this mess by switching system-wide bashrc support in bash-3.0.
(And while you're at it, system wide bash_logout support as well.)
zsh(1) does it well for quite some time now.
Which parts specifically would you move, though?