From 825d67fd35a809e779b916a82e63df8c8de01772 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 27 Aug 2018 21:13:29 +1200 Subject: [PATCH] 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 --- script/autobuild.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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(): -- 2.47.2