Where can I add to my path that it will be available for all users, all shells, all the time. In this case I want /opt/grails/bin to always be available even when being run as tomcat user from jenkins.
There are 6+ files that you can stick this in, but I have yet in my years of being a software dev who occasionally handles Linux sysadmin tasks to find a clear explanation of where you do
export PATH=$PATH:/opt/grails/bin
and have it available to every user, every type of shell, all the fXXXing time.
I'm on Ubuntu 10.10 if that matters.
Thanks
Usually it's /etc/profile (readed by bash, dash, ksh, and its "sh" modes).
For system users, you can declare single variables, at /etc/environment. It's not a good practice but it works (I used to use it for JAVA_HOME etc).
The main issue with PATH is that it should be different for system users and for system superusers. So instead of a single variable in /etc/environment, I would try patching /etc/profile (the debian/ubuntu way, is to put a script into /etc/profile.d/).
One line exports is a bashism, check the first lines of /etc/profile for portable syntax (to work with /bin/sh, dash, etc).
This solution shouldn't work for csh, tcsh, and the like shells, but should for bourne like shells.
On ubuntu, you can research about PAM, that has some things to say about environment and PATH, but it's more about login than about shell initialization.
Update: To go for PAM (su, sudo, etc) try: /etc/login.defs maybe the single file that you need.