extras-buildsys/common ExecUtils.py,1.4,1.5
Daniel Williams (dcbw)
fedora-extras-commits at redhat.com
Tue Jan 24 17:40:09 UTC 2006
Author: dcbw
Update of /cvs/fedora/extras-buildsys/common
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31541/common
Modified Files:
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ExecUtils.py 14 Nov 2005 19:13:01 -0000 1.4
+++ ExecUtils.py 24 Jan 2006 17:39:46 -0000 1.5
@@ -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