LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   customising .profile with env variables. (https://www.linuxquestions.org/questions/linux-server-73/customising-profile-with-env-variables-742252/)

dxangel 07-23-2009 10:54 AM

customising .profile with env variables.
 
Daft question probably, but im having a blonde moment.

Centos 4.7-x86-64
App server running jboss

have customised env file here
Code:

/path/to/.env.file
( on an nfs mount, correct perms and user can read file )

jboss users .profile looks like this:

Code:

. /path/to/.env.file
export SOMETHING=BLAH
export SOMETHINGELSE=BLAHBLAH
export PATH=/mypath/bin:$PATH

now if i reload the profile, and use the command 'env' it picks up all the vars.

If i start a new session, it doesnt.

I have other app servers which pick up all the vars from the file correctly, and their .profile is exactly the same as this server.

ideas?

TIA.

chrism01 07-23-2009 08:35 PM

Quote:

If i start a new session,
Do you mean start a new xterm (or equiv)? iirc, if you are already logged in at least once and then change eg .profile, any new 'sessions' are cloned from the original login env, which is why changes to file don't show up. It doesn't actually log you in, so it doesn't run that file.
Apologies if I misunderstood.

dxangel 07-24-2009 03:20 AM

Yes, that is correct.

So how can i force the machine to read the new .profile? reboot?

dxangel 07-24-2009 04:10 AM

machine rebooted.

same issue.

ran (as root)

Code:

su - jbossuser -c 'env'
fails to bring up the correct environment variables.


All times are GMT -5. The time now is 03:06 PM.