Stop the process using the WM_CLOSE method for Windows (which requires
that you don't specify the SAMECONSOLE option) and you'll see the results
you expect in the output (e.g. the output will contain the ping
statistics). For example:
C:\>STAF local PROCESS START SHELL COMMAND "ping 9.41.99.99 -n 1000000"
RETURNSTDOUT STDERRTOSTDOUT STDOUT C:/temp/ping.out
Response
--------
35
C:\>STAF local PROCESS STOP HANDLE 35 USING WM_CLOSE
Response
--------
C:\>type C:\temp\ping.out
Pinging 9.41.99.99 with 32 bytes of data:
Reply from 9.41.99.99: bytes=32 time<1ms TTL=128
Reply from 9.41.99.99: bytes=32 time<1ms TTL=128
Reply from 9.41.99.99: bytes=32 time<1ms TTL=128
Reply from 9.41.99.99: bytes=32 time<1ms TTL=128
Reply from 9.41.99.99: bytes=32 time<1ms TTL=128
Reply from 9.41.99.99: bytes=32 time<1ms TTL=128
Ping statistics for 9.41.99.99:
Packets: Sent = 6, Received = 6, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>STAF local PROCESS FREE HANDLE 35
Response
--------
C:\>
Note that you can alternatively specify the default method to use to stop
the process on the PROCESS START request so that you then don't need to
specify the stop method to use on the PROCESS STOP request. For example:
C:\>STAF local PROCESS START SHELL COMMAND "ping 9.41.99.99 -n 1000000"
STOPUSING WM_CLOSE RETURNSTDOUT STDERRTOSTDOUT STDOUT C:/temp/ping.out
Response
--------
38
C:\>staf local PROCESS STOP HANDLE 38
Response
--------
C:\>staf local PROCESS FREE HANDLE 38
Response
--------
C:\>
Also, note that when processes are STARTed asynchronously like you are
doing, the termination timestamp and return code are stored by STAF for
later retrieval. In order to free these values (and to free up the memory
used to do this), you must use the PROCESS FREE command. You may only free
information for processes that are already stopped. You may free the
termination information for a single process, all the stopped processes of
a given workload, or all stopped processes that have been started by STAF.
This is talked about in section "8.12.7 FREE" in the STAF User's Guide.
The syntax of the PROCESS FREE request is:
FREE <ALL | WORKLOAD <Name> | HANDLE <Handle>>
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
From: Gary Guo <javag...@gmail.com>
To: staf-users@lists.sourceforge.net
Date: 01/18/2011 01:08 PM
Subject: [staf-users] Stop PROCESS START on Windows 2008 using
SSIGINT (Ctrl-C)
Hi,
I have a question about PROCESS SERVICE - START and STOP on Windows 2008.
1. Started the following START command on Windows via PROCESS Service.
START SHELL ASYNC RETURNSTDOUT RETURNSTDERR COMMAND ping 192.168.1.1 -n
1000000 STDOUT c:\windows\temp\stdout.win STDERR
c:\windows\temp\stderr.win SAMECONSOLE
2. Tried to STOP the above command via handle# before 1000000 times reach
STOP HANDLE <handle#> USING SIGINT
But, I didn't get the expected result.
######## Start of the result #######
Pinging 192.168.7.43 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
######## End of the result #######
There is the following part missing.
--- 192.168.1.1 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 32ms
rtt min/avg/max/mdev = 0.237/0.269/0.311/0.029 ms
[My question?]
1. Even though I defined SAMECONSOLE in START-ed PROCESS, it seems it
doesn't work using SIGINT (Ctrl-C)
2. How can I STOP Async process START-ed using SIGINT Ctrl-C?
Thanks,
Gary
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users