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 » IBM MQ Installation/Configuration Support » systemd

Post new topic  Reply to topic Goto page 1, 2  Next
 systemd « View previous topic :: View next topic » 
Author Message
fbronx
PostPosted: Fri Feb 19, 2016 2:28 am    Post subject: systemd Reply with quote

Novice

Joined: 11 Apr 2007
Posts: 22

I'm trying to add a Websphere MQ queuemanager start / stop to systemd on Red Hat 7.
We run WebSphere MQ 7.5.0.5
I've created a mq@.service as follows:

Code:

[Unit]
Description=Websphere MQ %i

[Service]
Type=forking
User=mqm
Group=mqm
ExecStart=/opt/mqm/bin/strmqm %i
ExecStop=/opt/mqm/bin/endmqm -i %i
KillMode=none
LimitNOFILE=10240
LimitNPROC=4096
TimeoutSec=30

[Install]
WantedBy=multi-user.target


I've used this as example: http://unix.stackexchange.com/questions/234702/how-to-start-and-stop-a-listener-service-together-with-a-custom-service

It works when I start / stop a queuemanager on the commandline:

systemctl start mq@PIGEON

but when I reboot the server, I get 'Status not available' when running dspmq for the PIGEON queumanager and I can't use the queuemanager.

systemctl status mq@PIGEON :

Code:

mq@PIGEON.service - Websphere MQ PIGEON
   Loaded: loaded (/etc/systemd/system/mq@.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2016-02-19 10:53:40 CET; 29min ago
  Process: 1040 ExecStart=/opt/mqm/bin/strmqm %i (code=exited, status=0/SUCCESS)
 Main PID: 1881 (amqzxma0)
   CGroup: /system.slice/system-mq.slice/mq@PIGEON.service
           +-1881 /opt/mqm75/bin/amqzxma0 -m PIGEON
           +-2021 /opt/mqm75/bin/amqzfuma -m PIGEON
           +-2042 /opt/mqm75/bin/amqzmuc0 -m PIGEON
           +-2135 /opt/mqm75/bin/amqzmur0 -m PIGEON
           +-2136 /opt/mqm75/bin/amqzmuf0 -m PIGEON
           +-8654 /opt/mqm75/bin/amqrrmfa -m PIGEON -t2332800 -s2592000 -p2592000 -g5184000 -c3600
           +-8655 /opt/mqm75/bin/amqzdmaa -m PIGEON
           +-9011 /opt/mqm75/bin/amqzmgr0 -m PIGEON
           +-9023 /opt/mqm75/bin/amqfqpub -mPIGEON
           +-9073 /opt/mqm75/bin/amqzlaa0 -mPIGEON -fip0
           +-9074 /opt/mqm75/bin/runmqchi -m PIGEON -q SYSTEM.CHANNEL.INITQ -r
           +-9076 /opt/mqm75/bin/amqpcsea PIGEON
           +-9077 /opt/mqm75/bin/amqfcxba -m PIGEON
           +-9081 /opt/mqm75/bin/runmqlsr -r -m PIGEON -t TCP -p 1421

Feb 19 10:53:19 <hostname> systemd[1]: Starting Websphere MQ PIGEON...
Feb 19 10:53:20 <hostname> strmqm[1040]: WebSphere MQ queue manager 'PIGEON' starting.
Feb 19 10:53:20 <hostname> strmqm[1040]: The queue manager is associated with installation 'Installation1'.
Feb 19 10:53:20 <hostname> strmqm[1040]: 5 log records accessed on queue manager 'PIGEON' during the log replay phase.
Feb 19 10:53:20 <hostname> strmqm[1040]: Log replay for queue manager 'PIGEON' complete.
Feb 19 10:53:20 <hostname> strmqm[1040]: Transaction manager state recovered for queue manager 'PIGEON'.
Feb 19 10:53:39 <hostname> strmqm[1040]: WebSphere MQ queue manager 'PIGEON' started using V7.5.0.5.
Feb 19 10:53:40 <hostname> systemd[1]: Started Websphere MQ PIGEON.


qmstatus.ini states that the queuemanager is running ...

Any idea what can be wrong? Is systemd supported for WebSphere MQ because I can't find that much information about it ...
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 19, 2016 5:33 am    Post subject: Re: systemd Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

fbronx wrote:
I've used this as example: http://unix.stackexchange.com/questions/234702/how-to-start-and-stop-a-listener-service-together-with-a-custom-service

It works when I start / stop a queuemanager on the commandline:

systemctl start mq@PIGEON

but when I reboot the server, I get 'Status not available' when running dspmq for the PIGEON queumanager and I can't use the queuemanager.


Any idea what can be wrong? Is systemd supported for WebSphere MQ because I can't find that much information about it ...


Sounds to me that when you try to use the qmgr after reboot, you are set up for the wrong installation.

Did you source the MQ Environment before issuing the dspmq command?

What is the version of your installation? Is your installation the primary installation?

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fbronx
PostPosted: Fri Feb 19, 2016 5:55 am    Post subject: Reply with quote

Novice

Joined: 11 Apr 2007
Posts: 22

This is the output of dspmqver:

Code:
[mqm75]$ dspmqver
Name:        WebSphere MQ
Version:     7.5.0.5
Level:       p750-005-150424
BuildType:   IKAP - (Production)
Platform:    WebSphere MQ for Linux (x86-64 platform)
Mode:        64-bit
O/S:         Linux 3.10.0-229.20.1.el7.x86_64
InstName:    Installation1
InstDesc:
Primary:     Yes
InstPath:    /opt/mqm75
DataPath:    /var/mqm
MaxCmdLevel: 750
LicenseType: Production


After installation we've executed this (there is only one installation):

Code:
/opt/mqm75/bin/setmqinst -i -p /opt/mqm75
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 19, 2016 6:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Before executing dspmq, on your command prompt source the mq environment:
Code:
. setmqenv -s

Note the dot space at the beginning.

You might want to add that to your profile...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fbronx
PostPosted: Fri Feb 19, 2016 6:15 am    Post subject: Reply with quote

Novice

Joined: 11 Apr 2007
Posts: 22

No change:

Code:
[system]$ . setmqenv -s
[system]$ dspmq
QMNAME(PIGEON)                                            STATUS(Status not available)
[system]$
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Feb 19, 2016 7:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Is this an MI queue manager?

can you see the relevant mq processes running?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 19, 2016 7:46 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

mqjeff wrote:
Is this an MI queue manager?

can you see the relevant mq processes running?

If this is indeed an MI queue manager his exec start and exec stop are all wrong...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fbronx
PostPosted: Sun Feb 21, 2016 10:45 pm    Post subject: Reply with quote

Novice

Joined: 11 Apr 2007
Posts: 22

Code:
$ ps -ef | grep mq
mqm       1906     1  0 Feb19 ?        00:00:02 /opt/mqm75/bin/amqzxma0 -m PIGEON
mqm       2092  1906  0 Feb19 ?        00:00:01 /opt/mqm75/bin/amqzfuma -m PIGEON
mqm       2103  1906  0 Feb19 ?        00:00:01 /opt/mqm75/bin/amqzmuc0 -m PIGEON
mqm       2261  1906  0 Feb19 ?        00:00:04 /opt/mqm75/bin/amqzmur0 -m PIGEON
mqm       2262  1906  0 Feb19 ?        00:00:02 /opt/mqm75/bin/amqzmuf0 -m PIGEON
mqm       8712  1906  0 Feb19 ?        00:00:00 /opt/mqm75/bin/amqrrmfa -m PIGEON -t2332800 -s2592000 -p2592000 -g5184000 -c3600
mqm       8713  1906  0 Feb19 ?        00:00:00 /opt/mqm75/bin/amqzdmaa -m PIGEON
mqm       9028  1906  0 Feb19 ?        00:00:00 /opt/mqm75/bin/amqzmgr0 -m PIGEON
mqm       9040  2262  0 Feb19 ?        00:00:01 /opt/mqm75/bin/amqfqpub -mPIGEON
mqm       9083  1906  0 Feb19 ?        00:00:10 /opt/mqm75/bin/amqzlaa0 -mPIGEON -fip0
mqm       9084  9028  0 Feb19 ?        00:00:01 /opt/mqm75/bin/runmqchi -m PIGEON -q SYSTEM.CHANNEL.INITQ -r
mqm       9087  9028  0 Feb19 ?        00:00:01 /opt/mqm75/bin/amqpcsea PIGEON
mqm       9088  9040  0 Feb19 ?        00:00:00 /opt/mqm75/bin/amqfcxba -m PIGEON
mqm       9090  9028  0 Feb19 ?        00:00:00 /opt/mqm75/bin/runmqlsr -r -m PIGEON -t TCP -p 1421


And qmstatus.ini has CurrentStatus=Running
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Feb 22, 2016 5:27 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

What userId are you using after system restart to work with the queue manager?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fbronx
PostPosted: Tue Feb 23, 2016 5:16 am    Post subject: Reply with quote

Novice

Joined: 11 Apr 2007
Posts: 22

I'm using my admin user. We use Centrify here ... Could this be the problem? Although it's weird that it works when I start/stop the service manually.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 23, 2016 6:23 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

fbronx wrote:
I'm using my admin user. We use Centrify here ... Could this be the problem? Although it's weird that it works when I start/stop the service manually.


When you do it from the service, please make sure of the following points:
Before issuing the strmqm command or endmqm command make sure that the environment is set by sourcing it. Typically this type of setup does not carry the same environment as when you login...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fbronx
PostPosted: Thu Feb 25, 2016 2:16 am    Post subject: Reply with quote

Novice

Joined: 11 Apr 2007
Posts: 22

When I'm using this script in ExecStart, it still doesn't work on reboot ...

Code:
#!/bin/sh
whoami
. setmqenv -p /opt/mqm75 -l
/opt/mqm75/bin/strmqm $1
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 25, 2016 5:29 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

fbronx wrote:
When I'm using this script in ExecStart, it still doesn't work on reboot ...

Code:
#!/bin/sh
whoami
. setmqenv -p /opt/mqm75 -l
/opt/mqm75/bin/strmqm $1

And what is the error?
have you tried
Code:
#!/bin/sh
. /opt/mqm75/bin/setmqenv -p /opt/mqm75


Nothing tells me that the path to setmqenv would be known in the shell trying to execute it...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
arthurbarr
PostPosted: Thu Apr 14, 2016 9:49 am    Post subject: Reply with quote

Newbie

Joined: 04 Feb 2016
Posts: 4

Hi,

I think you need to run "systemctl enable mq@PIGEON" first. The problem is that, because you are using a templated service, systemd doesn't know which queue managers to start at boot time. Enabling the specific instances should do that. See my recent blog entry on developerWorks: https://www.ibm.com/developerworks/community/blogs/messaging/entry/mq_linux_systemd?lang=en

Regards,
Arthur
Back to top
View user's profile Send private message
NickSz
PostPosted: Wed Feb 20, 2019 10:06 am    Post subject: systemd and multi instance mq Reply with quote

Novice

Joined: 26 Jul 2008
Posts: 12
Location: Zurich

Hello all,

i followed Arthur's post on developerworks to put up a templated systemd script for starting and stopping mq and it works well.

I then raised a PMR for same issue with multi-instance but it was denied as it is something that does not need to be provided by IBM.
Then i tryied to request a RFE but it was already denied because it does not belongs to MQ

Now i'm asking myself if really nobody is using multi-instance mq on modern linux with systemd?
T. Rob describes it very interesting but also disapointing:
https://t-rob.net/2017/10/22/mq-startstop-woes/

Do i really have to spend many nights until i achieve something fairly robust?

Do you have any hints?

Thanks
Nicolaie
_________________
best regards
Nicolaie
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » systemd
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.