The PROCESS service provides a couple of ways to know when a process has 
completed:

1) If you submit the PROCESS START request synchronously, e.g. using the 
WAIT option, then the PROCESS START request does not complete until the 
command it started completes.  No looping is needed.

2) If you submit the PROCESS START request asynchronously, e.g. don't use 
the WAIT option, then you can also use the NOTIFY ONEND option to notify 
the handle that submitted the PROCESS START request by sending a message 
to the submitting handle's queue when the process completes.  So, you can 
submit a QUEUE WAIT request to wait for this message.  If you are waiting 
for just one STAF/Process/End message on this queue, then you do not need 
to submit this request within a loop.  If you want a handle other than the 
one that submitted the PROCESS START request to be notified when the 
process completes, then you can use the optional HANDLE or NAME options, 
and if you want a different machine to be notified, you can specify the 
optional MACHINE option.  You can also specify the optional KEY option 
which will include whatever additional information you want in the 
message.  See section "8.12 Process Service" in the STAF User's Guide at 
xxx for more information on these options.

*** PROCESS Service Help ***

START [SHELL [<Shell>]] COMMAND <Command> [PARMS <Parms>] [WORKDIR 
<Directory>]
      [VAR <Variable>=<Value>]... [ENV <Variable>=<Value>]... 
[USEPROCESSVARS]
      [WORKLOAD <Name>] [TITLE <Title>] [WAIT [<Number>[s|m|h|d|w]] | 
ASYNC]
      [STOPUSING <Method>] [STATICHANDLENAME <Name>]
      [NEWCONSOLE | SAMECONSOLE] [FOCUS <Background | Foreground | 
Minimized>]
      [USERNAME <User Name> [PASSWORD <Password>]]
      [DISABLEDAUTHISERROR | IGNOREDISABLEDAUTH]
      [STDIN <File>] [STDOUT <File> | STDOUTAPPEND <File>]
      [STDERR <File> | STDERRAPPEND <File> | STDERRTOSTDOUT]
      [RETURNSTDOUT] [RETURNSTDERR] [RETURNFILE <File>]...
      [NOTIFY ONEND [HANDLE <Handle> | NAME <Name>]
      [MACHINE <Machine>] [PRIORITY <Priority>] [KEY <Key>]]

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




"Uma Maheswar Chilukuri" <u...@mach.com> 
01/24/2010 03:33 AM

To
<staf-users@lists.sourceforge.net>
cc

Subject
[staf-users] Event when a child process exits






Hi,
How to determine a process(child process) which is started by STAF with 
PROCESS service is exited by the parent process?
One way might be by using QUEUE service and checking for 
?STAF/Process/End? type messages. This requires a looping.
Is there any other way which is similar to getting event like SIGCHLD 
signal so that there is no looping required.
Thanks
Uma. 

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for 
Conference
attendees to learn about information security's most important issues 
through
interactions with peers, luminaries and emerging and established 
companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to