Maybe you should explain what you are really trying to do, but isn’t working.
Simple stuff, just trying to install chruby system wide. I could use profile.local or source its snippet somewhere else and move on, but now I’m curious regarding profile.d.
Your Gnome session runs a bash script on startup. And that runs “/etc/profile” which puts PROFILEREAD into your environment. This is deliberate. The idea is that these scripts should only be run once. And since that is in your environment for your entire Gnome session, it is present in any “xterm” or “gnome-terminal” that you start.
I thought that would be the case; in fact, I had tested for that before opening this thread and have tested again now. It makes perfect sense that gnome-terminal “caches” the files deliberately.
The “problem” is that it does not run the scripts again after a cold boot. Maybe it only does so on the user’s first login? I have found nothing regarding this behavior on gnome-terminal online doc.
As you see there is no mentioning of /etc/profile.d, nor of /etc/profile.local. The usage of those directory and file solely depnds on code inside /etc/profile:
Yep, I’m aware of that. For testing purposes, I’ve placed some echos and aliases only on /etc/profile. However,
test -z $PROFILEREAD
is always false in gnome-terminal since PROFILEREAD is always true.
My guess is that you perhaps didn’t create your file in the form of an executable script… See the other files in the directory as templates for what works.
I have indeed used the others as templates, checking permissions and ownership. No files there have the +x flag. Besides, my test echos and aliases in /etc/profile are not being run either since PROFILEREAD seems to be always true. It really does seem that gnome-terminal has built its cache once and is not refreshing on startup.