0

We can put a 3rd party apps new global PATH in /etc/profile, appending to the original $PATH, ok.

But.. I can see that the /etc/profile file is provided by a package: aaa_base. What would happen if someone upgrade the aaa_base?

The Q: How can we ensure that the $PATH stays somewhere, where an upgrade wouldn't modify it?

3

Since you have an existing /etc/profile.d directory (and presumably the corresponding /etc/profile or /etc/${SHELL}rc files that source files in that directory), I'd recommend placing an /etc/profile.d/3rd-party-app.sh and/or /etc/profile.d/3rd-party-app.csh file with the required code. If you are the packager of the 3rd-party app, you could include those files in the packaging so that they are installed, updated, and removed by the package manager. Otherwise, as a user of the software, placing those files there will make them unmanaged, and so unaffected by OS package updates.

UPDATE from OP:

https://www.suse.com/documentation/sles11/book_sle_admin/data/sec_adm_whatistheshell.html

/etc/profile Do not modify this file, otherwise your modifications can be destroyed during your next update!

/etc/profile.local Use this file if you extend /etc/profile

/etc/profile.d/ Contains system-wide configuration files for specific programs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.