You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by aj...@apache.org on 2005/04/26 23:10:37 UTC

svn commit: r164881 - /gump/live/python/gump/util/process/launcher.py

Author: ajack
Date: Tue Apr 26 14:10:36 2005
New Revision: 164881

URL: http://svn.apache.org/viewcvs?rev=164881&view=rev
Log:
Release the 'setpgid' fix.

Modified:
    gump/live/python/gump/util/process/launcher.py

Modified: gump/live/python/gump/util/process/launcher.py
URL: http://svn.apache.org/viewcvs/gump/live/python/gump/util/process/launcher.py?rev=164881&r1=164880&r2=164881&view=diff
==============================================================================
--- gump/live/python/gump/util/process/launcher.py (original)
+++ gump/live/python/gump/util/process/launcher.py Tue Apr 26 14:10:36 2005
@@ -91,6 +91,9 @@
             
             # Child gets PID = 0
             if 0 == forkPID:
+                # Become a process group leader
+                os.setpgrp()
+                
                 # Run the information within this file...
                 os._exit(runProcess(execFile,0))
             
@@ -101,7 +104,7 @@
                 if cmd.timeout:
                     import threading
                     timer = threading.Timer(cmd.timeout, \
-		    		shutdownProcessAndProcessGroup, [forkPID])
+		    		    shutdownProcessAndProcessGroup, [forkPID])
                     timer.start()
             
                 # Run the command
@@ -198,8 +201,8 @@
     log.warn('Kill process group (anything launched by PID %s)' % (pid))    
     try:
         pgrpID=os.getpgid(pid)
-        log.warn('Kill process group %s (anything launched by PID %s) [from %s]' \
-                    % (pgrpID, pid, os.getpid()))  
+        log.warn('Kill process group %s (i.e. anything launched by PID %s) [from %s, for %s]' \
+                    % (pgrpID, pid, os.getpid(), default.gumpid))  
         if -1 != pgrpID:
             os.killpg(pgrpID,signal.SIGKILL)
         else:
@@ -216,7 +219,6 @@
     log.warn('Kill all child processed (anything launched by PID %s)' % (pid))    
     try:
         os.kill(pid,signal.SIGKILL)
-        gumpid
     except Exception, details:
         log.error('Failed to dispatch signal ' + str(details), exc_info=1)