From: Andrew Bartlett Date: Mon, 27 Aug 2018 09:13:29 +0000 (+1200) Subject: autobuild: Avoid subshell for tail -f invocation X-Git-Tag: tdb-1.3.17~1993 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=825d67fd35a809e779b916a82e63df8c8de01772;p=thirdparty%2Fsamba.git autobuild: Avoid subshell for tail -f invocation 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 Reviewed-by: Gary Lockyer Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Aug 29 08:20:55 CEST 2018 on sn-devel-144 --- diff --git a/script/autobuild.py b/script/autobuild.py index 6ad1941890b..fec64094c00 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -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():