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 » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » [SOLVED]writting a shell script to stop/start workflow

Post new topic  Reply to topic
 [SOLVED]writting a shell script to stop/start workflow « View previous topic :: View next topic » 
Author Message
zaklum
PostPosted: Mon May 09, 2005 12:20 pm    Post subject: [SOLVED]writting a shell script to stop/start workflow Reply with quote

Voyager

Joined: 17 Mar 2005
Posts: 96
Location: Boca Raton

Hi guys,
I'm trying to write a simple shell script that will stop and start my workflow. This implies for me to start the queue manager and the Trigger monitor. I am applying step by step as I do manually, everything seems to be normal, but when I run the fmcautil it hangs as usual. I have to do CNT + C to get out of it:

HERE IS THE SCRIPT:

/tmp #> cat stop_start_Workflow.sh
#!/bin/ksh



strmqm FMCQM
runmqtrm -m FMCQM -q FMCTRIGGER &
fmcamain -y FMC &
fmcautil -y FMC -uADMIN -ppassword -f

HERE IS MY OUTPUT:

Waiting for a trigger message
- FMC16301I UserID 'ADMIN' connected to system 'FMCSYS'.
- FMC16301I UserID 'ADMIN' connected to system 'FMCSYS'.
= FMC16110I Receive thread for userID 'ADMIN' at system 'FMCSYS' started.
= FMC16110I Receive thread for userID 'ADMIN' at system 'FMCSYS' started.
FMC15010I Main Menu:
s ... System Commands Menu
m ... Select Server Menu
e ... Errorlog Commands Menu
l ... Systemlog Commands Menu
u ... User Commands Menu
x ... Exit Main Menu
FMC10200I Execution server for system FMCSYS started.
FMC10200I Execution server for system FMCSYS started.
> 05/09/05 16:08:16 FMCSYS: FMC10200I Execution server for system FMCSYS started.
FMC10200I Execution server for system FMCSYS started.
> 05/09/05 16:08:16 FMCSYS: FMC10500I Execution server instance started.
> 05/09/05 16:08:21 FMCSYS: FMC10000I System startup complete. System FMCSYS in system group FMCGRP is now running.
//here is the part where it hangs and I have to press CNTRL + C to exit.

is this normal?
after running the fmcautil -y userid -uuser -ppassword, do i need to select anything? I see that workflow starts withoout me selecting anything.

Regards,
Back to top
View user's profile Send private message
Ratan
PostPosted: Mon May 09, 2005 12:36 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

if you get this menu:

s ... System Commands Menu
m ... Select Server Menu
e ... Errorlog Commands Menu
l ... Systemlog Commands Menu
u ... User Commands Menu
x ... Exit Main Menu


it means WF is running and your admin utility connected to WF Server.

When you say "hanges" do mean you are not getting anymore output statements or are you unable to select any of the options?
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Mon May 09, 2005 12:53 pm    Post subject: Re: writting a shell script to stop/start workflow Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

zaklum wrote:

/tmp #> cat stop_start_Workflow.sh
#!/bin/ksh



strmqm FMCQM
runmqtrm -m FMCQM -q FMCTRIGGER &
fmcamain -y FMC &
fmcautil -y FMC -uADMIN -ppassword -f


Why do you have this line
Code:
fmcautil -y FMC -uADMIN -ppassword -f

If I ever write a startup script I wouldn't have this line in the script.

On the other hand, if you want to automate things:

fmcautil -y FMC -uADMIN -ppassword -f < fmcautil.input

where the file fmcautil.input would have the following
Code:
s
q
x
x


Moreover, you should nohup both the trigger monitor and fmcamain
Back to top
View user's profile Send private message Send e-mail Visit poster's website
zaklum
PostPosted: Mon May 09, 2005 1:08 pm    Post subject: Reply with quote

Voyager

Joined: 17 Mar 2005
Posts: 96
Location: Boca Raton

Ok,
Do I really need fmcautil to start workflow? isn't enought to do the following:

1. start queue manager
2. start trigger monitor
3. start administration server fmcamain

are these the only 3 steps required for workflow to do its operations of transferring FDL?

now when I shut down workflow then I need to run fmcautil, right?

thanks,
Back to top
View user's profile Send private message
Ratan
PostPosted: Mon May 09, 2005 1:16 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

you dont need to start your WF Server to import FDLs.

Fmcautil has nothing to do with starting WF Server.

starting fmcamain is enough to start WF Server (QM and trigger monitor should be running).
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
zaklum
PostPosted: Mon May 09, 2005 1:31 pm    Post subject: Reply with quote

Voyager

Joined: 17 Mar 2005
Posts: 96
Location: Boca Raton

great!!!

Now, how about to shut down fmcamain? do I need to run fmcautil or can I just do a kill -9 on fmcamain process?


thanks guys,

zaklum
Back to top
View user's profile Send private message
Ratan
PostPosted: Mon May 09, 2005 1:35 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

To shutdown WF Server, just killing fmcamain is not enough. you have to kill fmcemain, fmcsmain and fmccmain (if they are running). Best way is to use fmcautil to stop WF server (options s and d).
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
karthik
PostPosted: Mon May 09, 2005 1:38 pm    Post subject: Reply with quote

Centurion

Joined: 17 Oct 2003
Posts: 114

Easiest way to do it

echo sdxx | fmcautil -uadmin -ppassword -yCONFID -f

Thanks
Karthik
Back to top
View user's profile Send private message
vennela
PostPosted: Mon May 09, 2005 1:47 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Quote:
do I need to run fmcautil or can I just do a kill -9 on fmcamain process?

Killing is not a good idea. Use fmcautil in one of the above two methods.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
zaklum
PostPosted: Tue May 10, 2005 5:41 am    Post subject: Reply with quote

Voyager

Joined: 17 Mar 2005
Posts: 96
Location: Boca Raton

Hi guys,
Everything looks beautifu now, the only minor problem that I'm getting is the hanging when I do the starting part. Here is what I mean:

Waiting for a trigger message
FMC10200I Execution server for system FMCSYS started.
FMC10200I Execution server for system FMCSYS started.
FMC10200I Execution server for system FMCSYS started.
//right here it hangs and I have to hit enter to exit; I don't want this to be like this, since I might want to put this in a cron.

Here is the code:
echo "Choose a function from the menu: \n"
echo "1 - Start Workflow System\n"
echo "2 - Stop Workflow System\n"
read FUNCTION
print $FUNCTION
if [ "$FUNCTION" -eq 1 ]
then
print "Starting Workflow System ...Please wait!\n"
print "Starting the Queue Manager.....\n"
strmqm FMCQM | grep started
print "Starting the FMCTRIGGER.....\n"
runmqtrm -m FMCQM -q FMCTRIGGER &
print "Starting the Administration Server.....\n"
fmcamain -y FMC &
exit //this exit statement doesn't work
elif [ "$FUNCTION" -eq 2 ]
then
print "Workflow Shutting Down, please wait ...\n"
echo sdxx | fmcautil -uADMIN -ppassword -yFMC -f

fi
Back to top
View user's profile Send private message
zaklum
PostPosted: Tue May 10, 2005 6:57 am    Post subject: Reply with quote

Voyager

Joined: 17 Mar 2005
Posts: 96
Location: Boca Raton

Ok guys,
This problem is solved. Thank you very much for all your help.
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 » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » [SOLVED]writting a shell script to stop/start workflow
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.