diff --git a/scripts/runqemu b/scripts/runqemu index efb98ab9e0..410d2a9939 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1593,7 +1593,8 @@ def main(): def sigterm_handler(signum, frame): logger.info("SIGTERM received") - os.kill(config.qemupid, signal.SIGTERM) + if config.qemupid: + os.kill(config.qemupid, signal.SIGTERM) config.cleanup() # Deliberately ignore the return code of 'tput smam'. subprocess.call(["tput", "smam"])