Author |
Message
|
naveen_1507 |
Posted: Sun Aug 21, 2011 1:51 am Post subject: How to stop the Queue managers are running by shell script? |
|
|
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 |
|
 |
exerk |
Posted: Sun Aug 21, 2011 3:24 am Post subject: |
|
|
 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 |
|
 |
naveen_1507 |
Posted: Sun Aug 21, 2011 5:50 am Post subject: How to stop the Queue managers are running by shell script? |
|
|
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 |
|
 |
bruce2359 |
Posted: Sun Aug 21, 2011 6:06 am Post subject: |
|
|
 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 |
|
 |
naveen_1507 |
Posted: Sun Aug 21, 2011 7:54 am Post subject: How to stop the Queue managers are running by shell script? |
|
|
Newbie
Joined: 11 Aug 2011 Posts: 6
|
permission denailed. if i run the above code |
|
Back to top |
|
 |
Vitor |
Posted: Sun Aug 21, 2011 9:12 am Post subject: Re: How to stop the Queue managers are running by shell scri |
|
|
 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 |
|
 |
Vitor |
Posted: Sun Aug 21, 2011 9:22 am Post subject: Re: How to stop the Queue managers are running by shell scri |
|
|
 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 |
|
 |
|