autobuild: Avoid subshell for tail -f invocation
authorAndrew Bartlett <abartlet@samba.org>
Mon, 27 Aug 2018 09:13:29 +0000 (21:13 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 29 Aug 2018 06:20:55 +0000 (08:20 +0200)
This should mean one less process in the process tree, and less places to hold
FDs open.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13591

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 29 08:20:55 CEST 2018 on sn-devel-144

script/autobuild.py

index 6ad1941890b15e93c9ac0cef500db2ff8bc3ca4e..fec64094c0089d41a8260fd4e7b687adf2db016a 100755 (executable)
@@ -613,11 +613,11 @@ class buildlist(object):
             os.unlink(b.stderr_path)
 
     def start_tail(self):
-        cwd = os.getcwd()
-        cmd = "tail -f *.stdout *.stderr"
-        os.chdir(gitroot)
-        self.tail_proc = Popen(cmd, shell=True, close_fds=True)
-        os.chdir(cwd)
+        cmd = ["tail", "-f"]
+        for b in self.tlist:
+            cmd.append(b.stdout_path)
+            cmd.append(b.stderr_path)
+        self.tail_proc = Popen(cmd, close_fds=True)
 
 
 def cleanup():