From 24deda5a8985fb4efae82427456d13c5b879f2a1 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 3 Oct 2014 21:50:22 +0200 Subject: invoke setsid for each job This should cause each jenkins job to reside in its own session. Linux' automatic group scheduling should then cause jobs to be scheduled equally rather than processes. The expected result is that highly parallel jobs do not slow down single-cpu jobs. --- bin/setsid.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/setsid.py (limited to 'bin/setsid.py') diff --git a/bin/setsid.py b/bin/setsid.py new file mode 100755 index 00000000..32002ec7 --- /dev/null +++ b/bin/setsid.py @@ -0,0 +1,16 @@ +#!/usr/bin/python +"""backport of util-linux' setsid -w to Debian stable""" + +import os +import sys + +if __name__ == "__main__": + assert len(sys.argv) > 1 + pid = os.fork() + if pid == 0: + os.setsid() + os.execvp(sys.argv[1], sys.argv[1:]) + else: + cpid, status = os.wait() + assert cpid == pid + sys.exit(os.WEXITSTATUS(status)) -- cgit v1.2.3-70-g09d2