/etc/profile unconditionally adds /usr/local/bin (and /usr/local/sbin for root) to PATH. I don't believe this is the correct place to do this. 1. I don't know of any ebuild that installs into /usr/local/bin 2. If a user installs something into /usr/local/bin, they may add it to the PATH via /etc/env.d/ 3. ebuilds that install to /opt/<somepackage> usually install something into /etc/env.d. 4. "/opt/bin" is added via 00basic 5. There is no way to REMOVE /usr/local/bin (or even change it's relative ordering) without directly editing /etc/profile (which is a non-starter if I wanted to do it via a custom ebuild). Basically, item 5 is the thing that concerns me. I would like to be able to configure /usr/local/bin in a programmatic way just like any other path outside of /bin and /usr/bin. Not only is editing /etc/profile a pain on multiple machines, it makes etc-update that much more error prone. I'm thinking if the user installs something into /usr/local, then they can add something to, say, /etc/env.d/99local? Reproducible: Always Steps to Reproduce:
One other note, I'm not sure how legitimate this is. We don't include /etc/profile.env for root PATHs for security reasons. (See bug #156404.) Since gentoo does not install anything into /usr/local, is it a security issue to prepend it to the path?
edit your /etc/profile to suite your needs
(In reply to comment #2) > edit your /etc/profile to suite your needs Uh, ick. That blows when it's more than a handful of machines. I use gentoo because I have many machines that do not have similar configurations. I use custom ebuild overlays to manage configurations and such. Using a common /etc is not really an option. Is this to be one facet that Gentoo forces to be a certain way (i.e. I can't make this choice without editing a file that will get blown away in the next baselayout upgrade)?
who said /etc/profile gets blown away ? it's config protected, so unless you blow it away, it wont be your solution of /etc/env.d/ will get blown away automatically though as that directory is config masked as for this being some sort of weird Gentooism, every other distro out there ive checked does the same exact thing you could easily drop a file into /etc/profile.d/ that would delete elements from your PATH you (for some reason) find objectable
(In reply to comment #4) > who said /etc/profile gets blown away ? it's config protected, so unless you > blow it away, it wont be Eh, etc-update can still be a pain on multiple machines... :) > your solution of /etc/env.d/ will get blown away automatically though as that > directory is config masked Not if I put a file in there via a custom ebuild? > as for this being some sort of weird Gentooism, every other distro out there > ive checked does the same exact thing Didn't say it was weird, just not easily configurable. However: > you could easily drop a file into /etc/profile.d/ that would delete elements > from your PATH you (for some reason) find objectable Ah-hah! Great idea! Thank you very much. I was indeed looking for exactly that. Perfect! I appreciate you sticking through this and helping me out! :)