My system has worked just fine for a long long time, but its behavior just changed. Sure I can "just fix it" but it seems like there might be an unintended effect of something that changed in gentoo.
I am used to setting system aliases that affect every interactive shell in the system. Things like "alias dir = ls -al". These go into a drop-in file in /etc/profile.d/ since it's something I changed for my system.
But now since my most recent update, the dropins in /etc/profile.d are run but then overwritten with other aliases sourced in the directory /etc/bashrc.d/
So, I question the wisdom of turning every single config file into a directory. But there's nothing I can do about it, that's just modern life. I guess it's better than the windows registry or whatever voodoo they do in macos. At least these are human readable files. But I really miss easily remembered and consistent text files that configure your system.
But so I should be able to "source /etc/profile" and reasonably expect that the aliases in the dropin directory /etc/profile.d/ are executed and not stepped on. But that's not what happens.
Instead, the alias commands in /etc/bashrc.d/ are executed, as if /etc/profile.d/ didn't exist.
So the result is not at all what I want:
Code: Select all
bartali /home/jesnow # alias
alias df='df -h'
alias diff='diff --color=auto'
alias dir='dir --color=auto'
alias du='du -sh'
alias grep='grep --color=auto'
alias ls='ls --color=auto'
alias vdir='vdir --color=auto'
Code: Select all
# /etc/profile.d/aliases.sh system aliases
echo "/etc/profile.d/aliases.sh Aliases sourced"
alias dir='ls -alh'
alias du='du -sh'
alias df='df -h'
So now when I "source /etc/profile", I get
Code: Select all
bartali /home/jesnow # source /etc/profile
/etc/profile.d/aliases.sh Aliases sourced
/etc/bash/bashrc.d/10-Gentoo-Color.bash aliases sourced
What is confusing me is that /etc/bash/bashrc.d/10-gentoo-color.bash seems to be going out if its way *not* to do this:
Code: Select all
if (( gentoo_color > 0 )); then
# Colorize the output of diff(1), grep(1) and a few coreutils utilities.
for _ in diff dir grep ls vdir; do
alias "$_=$_ --color=auto"
done
.
.
.
fi
Code: Select all
jesnow@bartali ~ $ su
Password:
/etc/bash/bashrc.d/10-Gentoo-Color.bash aliases sourced
/etc/profile.d/aliases.sh Aliases sourced
/etc/bash/bashrc.d/10-Gentoo-Color.bash aliases sourced
bartali /home/jesnow #
This is really not what should be happening.
And when I open a new shell:
Code: Select all
/etc/bash/bashrc.d/10-Gentoo-Color.bash aliases sourced
jesnow@bartali ~ $
There is an ancient bug where this is all discussed:
https://bugs.gentoo.org/4854
So what went wrong with the basic bash startup scripts? I've had it working the way I want for at least a decade, and something changed.
Cheers,
Jon.




