summaryrefslogtreecommitdiff
path: root/buildscripts/buildlogger.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/buildlogger.py')
-rw-r--r--buildscripts/buildlogger.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/buildscripts/buildlogger.py b/buildscripts/buildlogger.py
index a31b3e2dfa1..0dfb5ab5f8c 100644
--- a/buildscripts/buildlogger.py
+++ b/buildscripts/buildlogger.py
@@ -238,6 +238,12 @@ def run_and_echo(command):
"""
proc = subprocess.Popen(command)
+ # We write the pid of the spawned process as the first line of buildlogger.py's stdout because
+ # smoke.py expects to use it to terminate processes individually if already running inside a job
+ # object.
+ sys.stdout.write("[buildlogger.py] pid: %d\n" % (proc.pid))
+ sys.stdout.flush()
+
def handle_sigterm(signum, frame):
try:
proc.send_signal(signum)
@@ -415,6 +421,12 @@ def loop_and_callback(command, callback):
stderr=subprocess.STDOUT,
)
+ # We write the pid of the spawned process as the first line of buildlogger.py's stdout because
+ # smoke.py expects to use it to terminate processes individually if already running inside a job
+ # object.
+ sys.stdout.write("[buildlogger.py] pid: %d\n" % (proc.pid))
+ sys.stdout.flush()
+
def handle_sigterm(signum, frame):
try:
proc.send_signal(signum)