| Author | 
		  Message
		 | 
		
		  | MB Developer | 
		  
		    
			  
				 Posted: Sun Jul 13, 2014 8:34 pm    Post subject: Working with MQ in CentOS | 
				     | 
			   
			 
		   | 
		
		
		    Disciple
 
 Joined: 03 Feb 2014 Posts: 179
  
  | 
		  
		    
			  
				Hi Experts,
 
Greetings.
 
 
 
But I have a doubt in CentOS Command prompt..
 
 
I will go to  root and then mqm.
 
 
 
[binary@localhost ~]$ su root
 
Password: 
 
[root@localhost binary]# su mqm
 
 
here when  I run any MQ commands then "Permission denied " will come . So How to give permissions here.
 
 
bash-4.1$ ./dspmq
 
bash: ./dspmq: Permission denied
 
 
when I goto this path / change the directory then all MQ Commands are working.
 
 
bash-4.1$ cd /opt/mqm/bin
 
 
bash-4.1$ ./dspmq
 
QMNAME(QM1)                                                STATUS(Ended immediately)
 
QMNAME(QM2)                                               STATUS(Ended unexpectedly)
 
bash-4.1$ 
 
 
 
 
bash-4.1$ ./dspmqver
 
Name:        WebSphere MQ
 
Version:     8.0.0.0
 
Level:       p000-L140506
 
BuildType:   IKAP - (Production)
 
Platform:    WebSphere MQ for Linux (x86-64 platform)
 
Mode:        64-bit
 
O/S:         Linux 2.6.32-431.el6.x86_64
 
InstName:    Installation1
 
InstDesc:    
 
Primary:     No
 
InstPath:    /opt/mqm
 
DataPath:    /var/mqm
 
MaxCmdLevel: 800
 
LicenseType: Trial
 
bash-4.1$ ./dspmq
 
QMNAME(jj)                                                STATUS(Ended immediately)
 
QMNAME(SK)                                                STATUS(Ended unexpectedly)
 
bash-4.1$ _________________ Thanks.... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | smdavies99 | 
		  
		    
			  
				 Posted: Sun Jul 13, 2014 9:16 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land. 
  | 
		  
		    
			  
				Do not run MQ commands as root. Run them using an account that is in the 'mqm' group.
 
Also, the solution is not to add root ro the mqm group.
 
 
My answer to your post on the Installation & Config forum shows what you need to do. Only use 'root' to create that account and set the password and group membership. Then everything can be done using that account.
 
 
To reiterate, Create an account that you will use for doing MQ work. Add that account to the mqm group.
 
 
It sounds to me like that you need to get a better understanding of Linux/Unix accounts and groups.
 
 
This is only the beginning and the steps are really only suitable for a test system/POC. Different procedures must be applied to production systems but you are nowhere near ready for that yet. _________________ WMQ User since 1999
 
MQSI/WBI/WMB/'Thingy' User since 2002
 
Linux user since 1995
 
 
 
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Sun Jul 13, 2014 10:10 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				You may also need to run setmqenv for the user... 
 
Especially since your installation is not the primary installation... 
 
   
	| Code: | 
   
  
	dspmqver
 
.......
 
Primary: No
 
....... | 
   
 
 
Have fun   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | exerk | 
		  
		    
			  
				 Posted: Mon Jul 14, 2014 12:49 am    Post subject: Re: Working with MQ in CentOS | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 02 Nov 2006 Posts: 6339
  
  | 
		  
		    
			  
				
   
	| MB Developer wrote: | 
   
  
	| [root@localhost binary]# su mqm | 
   
 
 
Try su - mqm, once you have set the installation as primary...
 
 
https://wiki.archlinux.org/index.php/Su
 
 
The hyphen has two effects:
 
 
1) switches from the current directory to the home directory of the new user (e.g., to /root in the case of the root user) by logging in as that user
 
 
2) changes the environmental variables to those of the new user as dictated by their ~/.bashrc. That is, if the first argument to su is a hyphen, the current directory and environment will be changed to what would be expected if the new user had actually logged on to a new session (rather than just taking over an existing session). _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | MB Developer | 
		  
		    
			  
				 Posted: Mon Jul 14, 2014 2:31 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Disciple
 
 Joined: 03 Feb 2014 Posts: 179
  
  | 
		  
		    
			  
				Hi smdavies99,
 
 
   
	| smdavies99 wrote: | 
   
  
	Do not run MQ commands as root. Run them using an account that is in the 'mqm' group.
 
Also, the solution is not to add root ro the mqm group.
 
 
My answer to your post on the Installation & Config forum shows what you need to do. Only use 'root' to create that account and set the password and group membership. Then everything can be done using that account.
 
 | 
   
 
 
 
Yes it's working  ....
 
 
PATH=$PATH:/opt/mqm/bin
 
export PATH 
 
 
 
[root@localhost binary]# PATH=$PATH:/opt/mqm/bin
 
[root@localhost binary]# export PATH
 
[root@localhost binary]# strmqcfg
 
MQ Explorer: Using existing workspace: /root/IBM/WebSphereMQ/workspace-Installation1/ (MQ 8.0)
 
[root@localhost binary]# dspmq
 
QMNAME(jj)                                                STATUS(Ended immediately) _________________ Thanks.... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | MB Developer | 
		  
		    
			  
				 Posted: Mon Jul 14, 2014 2:39 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Disciple
 
 Joined: 03 Feb 2014 Posts: 179
  
  | 
		  
		    
			  
				Hai fjb_saper,
 
 
Thanks for response..
 
 
   
	| fjb_saper wrote: | 
   
  
	You may also need to run setmqenv for the user... 
 
Especially since your installation is not the primary installation... 
 
   
	| Code: | 
   
  
	dspmqver
 
.......
 
Primary: No
 
....... | 
   
 
 
Have fun   | 
   
 
 
 
Is there any problem if installation is not primary installation ..
 
 
If Yes  then how to solve it at this level (i.e already installed what are the changes are required). _________________ Thanks.... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | exerk | 
		  
		    
			  
				 Posted: Mon Jul 14, 2014 2:43 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 02 Nov 2006 Posts: 6339
  
  | 
		  
		    
			  
				
   
	| MB Developer wrote: | 
   
  
	| Is there any problem if installation is not primary installation .. | 
   
 
 
No, but you'll have to set the environment every time you log in...
 
 
   
	| MB Developer wrote: | 
   
  
	| If Yes  then how to solve it at this level (i.e already installed what are the changes are required). | 
   
 
 
RTFM? _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | MB Developer | 
		  
		    
			  
				 Posted: Mon Jul 14, 2014 3:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Disciple
 
 Joined: 03 Feb 2014 Posts: 179
  
  | 
		  
		    
			  
				Hi exerk ,
 
 
 
 
Thank you for your quick response..and giving solution ....
 
 
 
[root@localhost Raj]# /opt/mqm/bin/setmqinst -i -p /opt/mqm
 
117 of 117 tasks have been completed successfully.
 
'Installation1' (/opt/mqm) set as the primary installation.
 
 
 
Primary:     Yes
 
InstPath:    /opt/mqm
 
DataPath:    /var/mqm
 
 
 
bash-4.1$ crtmqm QMM
 
There are 87 days left in the trial period for this copy of WebSphere MQ....... _________________ Thanks.... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |