Now /etc/profile.d has bash-completion.sh and java-config-2.sh, and only /etc/profile sources /etc/profile.d/*.sh. So that non-login shells can't get bash completion and java environment variables. The condition is serious when I enter a shell with 'sudo -s', which means that I must work without bash completion. My suggestion is to let /etc/bash/bashrc source /etc/profile.d/*.sh. Further, since /etc/profile sources /etc/bash/bashrc, /etc/profile needn't /etc/profile.d/*.sh any more if /etc/bash/bashrc instead of it.
no, bashrc files are for *non-login* shells. profile.d are for *login* shells. login shells source non-login files, but never the other way around.