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 IBM MQ Support » starting mq at boot on linux

Post new topic  Reply to topic
 starting mq at boot on linux « View previous topic :: View next topic » 
Author Message
vladimir_Sanchez
PostPosted: Wed Dec 22, 2004 11:14 am    Post subject: starting mq at boot on linux Reply with quote

Newbie

Joined: 21 Dec 2004
Posts: 6
Location: Chile

I need to start MQ at server boot. I'm kind on newby in linux/unix. What should I do?
I know I should start the MQ server and then the Mq listener.

Thanks in advance,

Vladimir
Back to top
View user's profile Send private message
clindsey
PostPosted: Wed Dec 22, 2004 12:19 pm    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Create a script that looks something like this one or modify this one and change the qmgr name:

Code:

#! /bin/sh
#

# init the rc.status env
. /etc/rc.status

echo "Running Prototype RC for MQSeries "
rc_reset

case "$1" in
start)
        echo -n "Starting WebSphere MQSeries"
        su - mqm -c "cd /opt/mqm/bin; ./strmqm yourqmgr "
        su - mqm -c "cd /opt/mqm/bin; ./strmqcsv yourqmgr "
        su - mqm -c "cd /opt/mqm/bin; ./runmqlsr -m yourqmgr -t TCP -p 1414 & "
        su - mqm -c "cd /opt/mqm/bin; ./runmqtrm -q YOUR.INIT.QUEUE -m yourqmgr & "

        rc_status -v
        ;;

stop)
        echo -n "Stoping WebSphere MQSeries"
        su - mqm -c "cd /opt/mqm/bin; ./endmqm -i yourqmgr "
        su - mqm -c "cd /opt/mqm/bin; ./endmqlsr -m yourqmgr & "

        rc_status -v
        ;;


restart)
        echo -n "Restarting WebSphere MQSeries"
        su - mqm -c "cd /opt/mqm/bin; ./endmqm -i yourqmgr"
        su - mqm -c "cd /opt/mqm/bin; ./endmqlsr -m yourqmgr& "
        su - mqm -c "cd /opt/mqm/bin; ./strmqm yourqmgr"
        su - mqm -c "cd /opt/mqm/bin; ./strmqcsv yourqmgr"
        su - mqm -c "cd /opt/mqm/bin; ./runmqlsr -m yourqmgr-t TCP -p 1414 & "
        su - mqm -c "cd /opt/mqm/bin; ./runmqtrm -q YOUR.INIT.QUEUE -m yourqmgr& "

        rc_status
        ;;

status)
        echo -n "WebSphere MQSeries status "
        su - mqm -c "cd /opt/mqm/bin; ./dspmq "
        su - mqm -c "cd /opt/mqm/bin; ./dspmqcsv "

        rc_status -v
        ;;

*)
        echo "Usage: $0 { start | stop | restart | status }"
        exit 1
        ;;
esac
rc_exit 0


You will need to be root to do this.
Put this file in /etc/rc.d. I call this one mqseries but the name doesn't matter.

Go to /etc/rc.d/rc2.d and create 2 links to this file.
K20mqseries -> ../mqseries
S20mqseries -> ../mqseries

The number, e.g. 20 can be any number that is not already assigned in this directory. The Sxxmqseries gets called when linux boots up in ring 2 and Sxxmqseries gets called when linux shuts down.

Repeat this for each ring you want to start/stop MQ, i.e. rc3.d, rc4.d, etc

Hope this helps,
Charlie
Back to top
View user's profile Send private message
vladimir_Sanchez
PostPosted: Wed Dec 22, 2004 1:02 pm    Post subject: Reply with quote

Newbie

Joined: 21 Dec 2004
Posts: 6
Location: Chile

Thanks!

Vladimir
Back to top
View user's profile Send private message
csaunders
PostPosted: Wed May 18, 2005 8:26 am    Post subject: Reply with quote

Acolyte

Joined: 27 Mar 2003
Posts: 64
Location: Arlington, Va

clindsey wrote:
Create a script that looks something like this one or modify this one and change the qmgr name:

Code:

#! /bin/sh
#

# init the rc.status env
. /etc/rc.status

echo "Running Prototype RC for MQSeries "
rc_reset

case "$1" in
start)
        echo -n "Starting WebSphere MQSeries"
        su - mqm -c "cd /opt/mqm/bin; ./strmqm yourqmgr "
        su - mqm -c "cd /opt/mqm/bin; ./strmqcsv yourqmgr "
        su - mqm -c "cd /opt/mqm/bin; ./runmqlsr -m yourqmgr -t TCP -p 1414 & "
        su - mqm -c "cd /opt/mqm/bin; ./runmqtrm -q YOUR.INIT.QUEUE -m yourqmgr & "

        rc_status -v
        ;;

stop)
        echo -n "Stoping WebSphere MQSeries"
        su - mqm -c "cd /opt/mqm/bin; ./endmqm -i yourqmgr "
        su - mqm -c "cd /opt/mqm/bin; ./endmqlsr -m yourqmgr & "

        rc_status -v
        ;;


restart)
        echo -n "Restarting WebSphere MQSeries"
        su - mqm -c "cd /opt/mqm/bin; ./endmqm -i yourqmgr"
        su - mqm -c "cd /opt/mqm/bin; ./endmqlsr -m yourqmgr& "
        su - mqm -c "cd /opt/mqm/bin; ./strmqm yourqmgr"
        su - mqm -c "cd /opt/mqm/bin; ./strmqcsv yourqmgr"
        su - mqm -c "cd /opt/mqm/bin; ./runmqlsr -m yourqmgr-t TCP -p 1414 & "
        su - mqm -c "cd /opt/mqm/bin; ./runmqtrm -q YOUR.INIT.QUEUE -m yourqmgr& "

        rc_status
        ;;

status)
        echo -n "WebSphere MQSeries status "
        su - mqm -c "cd /opt/mqm/bin; ./dspmq "
        su - mqm -c "cd /opt/mqm/bin; ./dspmqcsv "

        rc_status -v
        ;;

*)
        echo "Usage: $0 { start | stop | restart | status }"
        exit 1
        ;;
esac
rc_exit 0


You will need to be root to do this.
Put this file in /etc/rc.d. I call this one mqseries but the name doesn't matter.

Go to /etc/rc.d/rc2.d and create 2 links to this file.
K20mqseries -> ../mqseries
S20mqseries -> ../mqseries

The number, e.g. 20 can be any number that is not already assigned in this directory. The Sxxmqseries gets called when linux boots up in ring 2 and Sxxmqseries gets called when linux shuts down.

Repeat this for each ring you want to start/stop MQ, i.e. rc3.d, rc4.d, etc

Hope this helps,
Charlie

Im new to unix as well, I have this working on Solaris as a stand alone script, but how does solaris know at bootime which case to use? I.E. how do i know at bootime it will use the start case.... and at shutodwn use the stop case....
Back to top
View user's profile Send private message AIM Address
jefflowrey
PostPosted: Wed May 18, 2005 8:56 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

csaunders wrote:
Im new to unix as well, I have this working on Solaris as a stand alone script, but how does solaris know at bootime which case to use? I.E. how do i know at bootime it will use the start case.... and at shutodwn use the stop case....


Ask your systems administrator.

Really!

Or at least, use 'man' to look at the documentation for your initd.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
csaunders
PostPosted: Wed May 18, 2005 9:18 am    Post subject: Reply with quote

Acolyte

Joined: 27 Mar 2003
Posts: 64
Location: Arlington, Va

i guess this is what i needed from man page

It passes the argument 'stop' for scripts prefixed
with K and the argument 'start' for scripts prefixed with S.

cool thanks for the tip jeffrey
Back to top
View user's profile Send private message AIM Address
jefflowrey
PostPosted: Wed May 18, 2005 9:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

csaunders wrote:
jeffrey


_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JT
PostPosted: Wed May 18, 2005 10:31 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

jefflowrey wrote:
csaunders wrote:
jeffrey


You prefer "Jefferson'?
Back to top
View user's profile Send private message
csaunders
PostPosted: Wed May 18, 2005 10:32 am    Post subject: Reply with quote

Acolyte

Joined: 27 Mar 2003
Posts: 64
Location: Arlington, Va

jefflowrey wrote:
csaunders wrote:
jeffrey

sorry dude, guy at work is called that i got confused cause you cats have the same demeanor....
Back to top
View user's profile Send private message AIM Address
jefflowrey
PostPosted: Wed May 18, 2005 10:37 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

JT wrote:
jefflowrey wrote:
csaunders wrote:
jeffrey


You prefer "Jefferson'?


Given that it says that on my birth certificate... and compared to "Jeffrey", yes, yes I do.

And csaunders... you don't know my demeanor - unless I've met you in person and don't know you by "csaunders". At best, you know my MQSeries.net persona - and even then, you only know YOUR interpretation of it, not mine!

It's a complex world, and very hard to judge motivations from text alone!
_________________
I am *not* the model of the modern major general.
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 IBM MQ Support » starting mq at boot on linux
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.