mock mock.py,1.33,1.34

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


Author: dcbw

Update of /cvs/fedora/mock
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28244

Modified Files:
	mock.py 
Log Message:
Add an option to create a new process group so that both mock and
all of its children can be easily killed with kill(-<mock pid>) without
killing mock's parent (ie, plague-builder).



Index: mock.py
===================================================================
RCS file: /cvs/fedora/mock/mock.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- mock.py	19 Jan 2006 21:33:30 -0000	1.33
+++ mock.py	24 Jan 2006 16:07:11 -0000	1.34
@@ -648,6 +648,8 @@
             help="Arbitrary, unique extension to append to buildroot directory name")
     parser.add_option("--quiet", action ="store_true", dest="quiet", 
             default=False, help="quiet down output")
+    parser.add_option("--setpgrp", action ="store_true", dest="setpgrp", 
+            default=False, help="starts a new process group for mock")
 
     return parser.parse_args()
     
@@ -711,7 +713,12 @@
     if len(args) < 1:
         error("No srpm or command specified - nothing to do")
         sys.exit(50)
-    
+
+    # If requested, become a process group leader so that us and
+    # _all_ of our children can more easily be killed with kill(2)
+    if options.setpgrp:
+        os.setpgrp()
+
     # read in the config file by chroot name
     if options.chroot.endswith('.cfg'):
         cfg = '%s/%s' % (config_path, options.chroot)




More information about the scm-commits mailing list