extras-buildsys/common ExecUtils.py,1.2.2.2,1.2.2.3

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


Author: dcbw

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

Modified Files:
      Tag: STABLE_0_4
	ExecUtils.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: ExecUtils.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/common/ExecUtils.py,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -r1.2.2.2 -r1.2.2.3
--- ExecUtils.py	14 Nov 2005 19:15:22 -0000	1.2.2.2
+++ ExecUtils.py	24 Jan 2006 17:45:38 -0000	1.2.2.3
@@ -58,7 +58,7 @@
     fd = os.open(filespec, flags, 0644)
     return (fd, True)
 
-def exec_with_redirect(cmd, argv, stdin=0, stdout=1, stderr=2):
+def exec_with_redirect(cmd, argv, stdin=0, stdout=1, stderr=2, setpgrp=True):
     cmd = os.path.abspath(cmd)
     if not os.access (cmd, os.X_OK):
         raise RuntimeError(cmd + " can not be run")
@@ -75,6 +75,10 @@
 
     childpid = os.fork()
     if (not childpid):
+        # Become leader of a new process group if requested
+        if setpgrp:
+            os.setpgrp()
+
         if stdin != 0:
             os.dup2(stdin, 0)
             os.close(stdin)




More information about the fedora-extras-commits mailing list