ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » failing to make MQSERVER var value permanent on linux box

Post new topic  Reply to topic
 failing to make MQSERVER var value permanent on linux box « View previous topic :: View next topic » 
Author Message
raj429
PostPosted: Sat Mar 26, 2011 11:09 pm    Post subject: failing to make MQSERVER var value permanent on linux box Reply with quote

Acolyte

Joined: 04 Jul 2009
Posts: 53

HI,

I want to add MQSERVER environment variable value in my linux permanently(like XX-->environment variables-->user variables in windows).
Eachtime, I tried to edit .bash_profile, .bashrc, .profile , /etc/profile with below 2 lines

MQSERVER=XYX/TCP/XYY
export MQSERVER

And restarted the system every time I have changed in the above file.

but nothing i can see after issuing "echo $MQSERVER" in linux terminal.
am i missing anything or is there any way to make MQSERVER value applied to all the terminal instances.
Back to top
View user's profile Send private message
zpat
PostPosted: Sat Mar 26, 2011 11:32 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Using a CCDT is a better approach. However try

export MQSERVER=XYX/TCP/XYY
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Mar 27, 2011 6:41 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You should not need to restart the server. Logging out and logging back in should be enough. Beware however of the many different shells. It would be probably easier to set the variable in it's own file say in /etc/profile and then source it in each of the different shell profiles. So if you need to change it there is only one place you need to change it in.

PS if you don't know what sourcing an environment variable means, google it.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
gbaddeley
PostPosted: Sun Mar 27, 2011 3:04 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

Quote:
I want to add MQSERVER environment variable value in my linux permanently(like XX-->environment variables-->user variables in windows).
Eachtime, I tried to edit .bash_profile, .bashrc, .profile , /etc/profile with below 2 lines

MQSERVER=XYX/TCP/XYY
export MQSERVER

And restarted the system every time I have changed in the above file.


You need to know which shell your userid logs on as, and then edit the appropriate logon profile file. The commands you need to run to set and export an environment variable can vary between shells.

Your logon shell is identified in your entry in /etc/passwd

eg. for ksh (Korn Shell), the logon profile is ".profile" and you add
export MQSERVER=XYX/TCP/XYY
if you need to add a port number, the value will need to be in double quotes
export MQSERVER="XYX/TCP/XYY(1415)"

HTH
_________________
Glenn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » failing to make MQSERVER var value permanent on linux box
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.