I ran into this problem before and what I did to get around this (although not pretty) was to use powershell as the default STAF shell on all of our windows based servers by the following modification in the STAF.cfg:
#Customized for just Win based platforms to be powershell SET DEFAULTSHELL "C:/WINNT/system32/WindowsPowerShell/v1.0/powershell.exe -c %c" Then with a bit of powershell scripting you can easily determine each process id and kill them off. Again it was just easy since all of our windows servers already had powershell installed. I am sure someone on this list has a cleaner way but this worked for me. -g -----Original Message----- From: Eric Kadison [mailto:ekadi...@istor.com] Sent: Tuesday, January 13, 2009 7:16 PM To: staf-users@lists.sourceforge.net Subject: [staf-users] Stopping a Process under Win Can someone please help with a STAF process problem? Within an application we've written, we start a process on a slave host from a master host, all running Win2K3. The process on the slave host will, then, start 2 processes on that same host. (There can actually be several slave hosts, all running the same way). Normally, when the test ends, all the processes end by themselves. But, in case of an error, we want to abort all processes, so I wrote a Python method to kill all slave processes. All processes are Python (2.5.1). STAF start & stop requests are made by calling the submit method in the STAFHandle class of the PYSTAF module (STAF 3.2.5). The STAF request used to start a process is: START COMMAND "python path\\InitiatorHostProcess.py arguments" VAR "xxx" USEPROCESSVARS WORKDIR "path" TITLE "xxx" STDOUT "filename" STDERRTOSTDOUT NOTIFY ONEND NAME "xxx" KEY "xxx" The STAF requests used to stop a process is: STOP HANDLE "xxx" USING WM_CLOSE Starting processes works fine. Normal termination of processes is also fine (even the notification on end). But, I've encountered two problems will the abnormal kill all method: 1. From my Linux experience, I had expected that stopping the parent process on a Windows slave host would also stop the two child processes. This proved wrong. The parent seems be able to terminate leaving the two children running. Are there settings that will allow a STAF Process request from the master host to terminate all my spawned processes on a slave host? 2. Sometimes, the STAF call to stop a slave process just hangs. It appears the slave process just won't terminate. What could cause this? What Windows calls does STAF make on the slave host to "STOP" a process? Thanks, Eric ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users