Following on from my last post on how to add shared libraries to Linux's system library path I wanted to share a related tip on system-wide environment variables.
Common reasons for doing this are setting your locale, setting the location of a Java installation or specifying the character set that your database is using (if you use Oracle then that would be the NLS_LANG environment variable). Debian actually has a policy against system-wide environment variables stating "a program must not depend on environment variables to get reasonable defaults" and suggests that all programs should have wrapper shell scripts to set the relevant variables.
Ignoring this sound advice I tried adding them to
I couldn't find a complete way to do it (it wasn't picked up by any start scripts in
Technorati Tags: Environment, Variables, Ubuntu, Debian, Linux, Andrew Beacock
Common reasons for doing this are setting your locale, setting the location of a Java installation or specifying the character set that your database is using (if you use Oracle then that would be the NLS_LANG environment variable). Debian actually has a policy against system-wide environment variables stating "a program must not depend on environment variables to get reasonable defaults" and suggests that all programs should have wrapper shell scripts to set the relevant variables.
Ignoring this sound advice I tried adding them to
/etc/profile
but this didn't work when ssh was used from a remote machine to execute some commands (I was using Capistrano).I couldn't find a complete way to do it (it wasn't picked up by any start scripts in
/etc/init.d
) but I achieved the most success by placing my variables in /etc/environment
:LANG=en_GBJust remember that you don't need to
JAVA_HOME=/usr/local/src/java
export
anything! Technorati Tags: Environment, Variables, Ubuntu, Debian, Linux, Andrew Beacock
Comments
try this:
1. define a variable in /etc/environment e.g. envnotwork=true
2. reboot
3. in a user shell: set | grep envnotwork This will show the variable
4. do: sudo bash
5. again: set | grep envnotwork result: NO SHOW
I'll try to get a virtualised version of the latest Ubuntu running and see if I can figure it out...
Check back on my blog soon to see if I get a solution!
I am running 64 bit Ubuntu Precise Pangolin (12.04 LTS) on Amazon EC2.
But my application is still referring to library which it shouldn't be looking into.
Could you please help me what might be missing here.