Author |
Message
|
vladimir_Sanchez |
Posted: Wed Dec 22, 2004 11:14 am Post subject: starting mq at boot on linux |
|
|
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 |
|
 |
clindsey |
Posted: Wed Dec 22, 2004 12:19 pm Post subject: |
|
|
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 |
|
 |
vladimir_Sanchez |
Posted: Wed Dec 22, 2004 1:02 pm Post subject: |
|
|
Newbie
Joined: 21 Dec 2004 Posts: 6 Location: Chile
|
|
Back to top |
|
 |
csaunders |
Posted: Wed May 18, 2005 8:26 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed May 18, 2005 8:56 am Post subject: |
|
|
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 |
|
 |
csaunders |
Posted: Wed May 18, 2005 9:18 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed May 18, 2005 9:26 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Wed May 18, 2005 10:31 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
jefflowrey wrote: |
 |
You prefer "Jefferson'?  |
|
Back to top |
|
 |
csaunders |
Posted: Wed May 18, 2005 10:32 am Post subject: |
|
|
Acolyte
Joined: 27 Mar 2003 Posts: 64 Location: Arlington, Va
|
jefflowrey wrote: |
 |
sorry dude, guy at work is called that i got confused cause you cats have the same demeanor....  |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed May 18, 2005 10:37 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
JT wrote: |
jefflowrey wrote: |
 |
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 |
|
 |
|