From: Sharon L. <lu...@us...> - 2007-02-10 01:01:24
|
Try using the WM_CLOSE stop method for WIndows to stop the process AND it's child processes. PROCESS STOP HANDLE xx USING WM_CLOSE Note that RC 11 indicates that the process has completed. You probably got this because the main process was stopped. However, if it's child processes may still have been running. C:\>STAF local HELP ERROR 11 Response -------- Description: Process already complete Details : You are trying to stop a specific process that has either already been stopped or has finished execution on its own. The STAF User's Guide describes the process stop methods as follows: USING specifies the method used to stop the process. This option will resolve variables. The following methods are supported: SIGKILLALL - This unconditionally stops the process and all of its children processes. On Unix systems, this sends a SIGKILL signal to the process and all of its children processes. This is not supported on Windows systems, although WM_CLOSE has a similar effect for Windows console applications. This is the default for Unix systems. SIGKILL - This unconditionally stops the process. On Unix systems, this sends a SIGKILL signal to the process. On Windows, this calls TerminateProcess(). Note: This is the only guaranteed way to stop a process. In particular, most, if not all, Windows GUI applications can only be killed this way. This is the default for Windows. SIGTERM - On Unix systems, this sends a SIGTERM signal to the process. On Windows systems, this sends a CTRL-Break event to the process (note, the process must have been STARTed with the SAMECONSOLE option for this to work). SIGINT - On Unix systems, this sends a SIGINT signal to the process. On Windows systems, this sends a CTRL-C event to the process (note, the process must have been STARTed with the SAMECONSOLE option for this to work). WM_CLOSE - On Windows systems, this sends a WM_CLOSE message to the application. This is particularly useful for stopping console applications which spawn numerous child processes. This will not work on console applications started using the SAMECONSOLE option. This is not supported on Unix systems. -------------------------------------------------------------- Sharon Lucas IBM Austin, lu...@us... (512) 838-8347 or Tieline 678-8347 mh...@li... Sent by: sta...@li... 02/09/2007 06:49 PM To sta...@li... cc Subject [staf-users] PROCESS STOP On Windows XP, I have a run_forever.pl script, which was started via PROCESS START SHELL COMMAND "perl c:/test/run_forever.pl" I tried to stop it using PROCESS STOP HANDLE xx USING SIGKILL I did not see any error, but the run_forever script did not end. I tried PROCESS STOP HANDLE xx USING SIGKILL again and got rc=11 What am I doing wrong? Attached is the run_forever.pl script -- Regards, Mike Tran use warnings; use strict; use POSIX qw(strftime); use Time::Local; MAIN: { my $quit = 0; while (!$quit) { my $now_string = strftime "%Y-%m-%d %H:%M:%S", localtime; print "current time : $now_string\n"; sleep 10; } exit 0; } ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ staf-users mailing list sta...@li... https://lists.sourceforge.net/lists/listinfo/staf-users |