LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 07-23-2009, 11:54 AM   #1
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
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.
 
Old 07-23-2009, 09:35 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
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.
 
Old 07-24-2009, 04:20 AM   #3
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Original Poster
Rep: Reputation: 18
Yes, that is correct.

So how can i force the machine to read the new .profile? reboot?
 
Old 07-24-2009, 05:10 AM   #4
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Original Poster
Rep: Reputation: 18
machine rebooted.

same issue.

ran (as root)

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


Reply

Tags
environment variable


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting env variables in X wild_oscar Linux - General 3 04-29-2007 10:49 AM
env variables AbrahamJose Solaris / OpenSolaris 4 04-18-2006 01:31 PM
env variables ekdya Debian 3 03-14-2006 02:33 PM
setting env. variables arunsri Slackware 3 03-26-2005 06:49 AM
profile.env twk Linux - Distributions 1 10-20-2004 02:04 AM


All times are GMT -5. The time now is 05:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration