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): tcsh-6.12-5 How reproducible: Every time.
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 invocation. 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. Thanks, Peter
Tim, comment #1 might interest you.
I can't find any reference to /etc/bash.bashrc in the documentation or the binary.
chihiro:/tmp% wget -q http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz chihiro:/tmp% md5sum bash-3.0.tar.gz 26c4d642e29b3533d8d754995bc277b3 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" */ chihiro:/tmp%
(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 man page). 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?