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 22:24:59 UTC
svn commit: r164869 - /gump/trunk/python/gump/util/process/launcher.py
Author: ajack
Date: Tue Apr 26 13:24:58 2005
New Revision: 164869
URL: http://svn.apache.org/viewcvs?rev=164869&view=rev
Log:
We need a sub-process-group if we are attempting to kill at the group level, and not kill ourselves.
Modified:
gump/trunk/python/gump/util/process/launcher.py
Modified: gump/trunk/python/gump/util/process/launcher.py
URL: http://svn.apache.org/viewcvs/gump/trunk/python/gump/util/process/launcher.py?rev=164869&r1=164868&r2=164869&view=diff
==============================================================================
--- gump/trunk/python/gump/util/process/launcher.py (original)
+++ gump/trunk/python/gump/util/process/launcher.py Tue Apr 26 13:24:58 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,7 +201,7 @@
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]' \
+ log.warn('Kill process group %s (i.e. anything launched by PID %s) [from %s]' \
% (pgrpID, pid, os.getpid()))
if -1 != pgrpID:
os.killpg(pgrpID,signal.SIGKILL)