extras-buildsys/builder builder.py,1.49,1.50

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Tue Jan 24 17:40:07 UTC 2006


Author: dcbw

Update of /cvs/fedora/extras-buildsys/builder
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31541/builder

Modified Files:
	builder.py 
Log Message:
2006-01-24  Dan Williams  <dcbw at redhat.com>

    * common/ExecUtils.py
        - (exec_with_redirect): by default, have child start a new
            process group

    * builder/builder.py
        - (_handle_death): kill child's entire process group, not just
            the child itself




Index: builder.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/builder/builder.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- builder.py	18 Nov 2005 14:34:05 -0000	1.49
+++ builder.py	24 Jan 2006 17:39:40 -0000	1.50
@@ -133,10 +133,12 @@
         if self._status != 'cleanup':
             # Kill a running non-cleanup mock process, if any
             if self._childpid:
+                child_pgroup = 0 - self._childpid
                 try:
-                    os.kill(self._childpid, 9)
+                    # Kill all members of the child's process group
+                    os.kill(child_pgroup, 9)
                 except OSError, e:
-                    self._log("ERROR: Couldn't kill process %d: %s\n" % (self._childpid, e))
+                    self._log("ERROR: Couldn't kill child process group %d: %s\n" % (child_pgroup, e))
                 else:
                     # Ensure child process is reaped
                     self._log("Waiting for mock process %d to exit...\n" % self._childpid)




More information about the fedora-extras-commits mailing list