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 » How to stop the Queue managers are running by shell script?

Post new topic  Reply to topic
 How to stop the Queue managers are running by shell script? « View previous topic :: View next topic » 
Author Message
naveen_1507
PostPosted: Sun Aug 21, 2011 1:51 am    Post subject: How to stop the Queue managers are running by shell script? Reply with quote

Newbie

Joined: 11 Aug 2011
Posts: 6

i wrote a shell script but not working. responses is permission denailed for endmqm.

spusr="su - root -c"
queuemanagers=`dspmq | awk '{ print $1 }' | sed 's/QMNAME(//g;s/)//g'`
echo $queuemanagers
for i in $queuemanagers
do
$spusr `endmqm $i`
done





i used super user swithing.

kindly anybody solve this issue.

thanks in advance
Naveen
Back to top
View user's profile Send private message Send e-mail
exerk
PostPosted: Sun Aug 21, 2011 3:24 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

And what happens when the script is run as mqm as the user you su to? Do you think root should be issuing queue manager related commands?
_________________
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
View user's profile Send private message
naveen_1507
PostPosted: Sun Aug 21, 2011 5:50 am    Post subject: How to stop the Queue managers are running by shell script? Reply with quote

Newbie

Joined: 11 Aug 2011
Posts: 6

actually we have different users only in 'root' user only can end the queue managers. so i used su switch to super user.

even if i logon by root user and run the command also its not working..


please help me..



and one more task i have to do is to stop the daemons production execution in a particular path
Back to top
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Sun Aug 21, 2011 6:06 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

exerk wrote:
And what happens when the script is run as mqm as the user you su to?

_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
naveen_1507
PostPosted: Sun Aug 21, 2011 7:54 am    Post subject: How to stop the Queue managers are running by shell script? Reply with quote

Newbie

Joined: 11 Aug 2011
Posts: 6

permission denailed. if i run the above code
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Sun Aug 21, 2011 9:12 am    Post subject: Re: How to stop the Queue managers are running by shell scri Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

naveen_1507 wrote:
permission denailed. if i run the above code


Yes, so you said. Try running the script as mqm or other authorised user as everyone has said. Though I'm pleased to see you've got this far, after this earlier plea. And you only posted once this time.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Aug 21, 2011 9:22 am    Post subject: Re: How to stop the Queue managers are running by shell scri Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

And because it's Sunday, I offer this tip:

naveen_1507 wrote:
actually we have different users only in 'root' user only can end the queue managers. so i used su switch to super user.


While root is a "super user" in Unix, and you may have encountered this term researching shell scripts, being a super user does not mean it has the power of a god & can ride roughshod over the security.

(At least not directly)

So don't be fooled into thinking that you can just run everything as root and your security problems are over.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » How to stop the Queue managers are running by shell script?
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.