From 205ad41a22e5eb91ba994ba144655ac3497297b5 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 30 Oct 2012 16:47:05 -0400 Subject: [PATCH] zephyr_mirror: More reliable killing of other zephyr_mirror processes. (imported from commit ae00299114a74ebd582aec835ffd5f8127d8f55f) --- bots/zephyr_mirror.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index 0ef9c42..3182ea5 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -168,6 +168,8 @@ def maybe_restart_mirroring_script(): os.kill(child_pid, signal.SIGKILL) while True: try: + if bot_name == "extra_mirror.py": + os.execvp(root_path + "/extra_mirror.py", sys.argv) os.execvp(root_path + "/user_root/zephyr_mirror.py", sys.argv) except: print "Error restarting, trying again." @@ -534,7 +536,11 @@ if options.forward_from_humbug: # First check that there are no other bots running cmdline = " ".join(sys.argv) -proc = subprocess.Popen(['pgrep', '-U', os.environ["USER"], "-f", cmdline], +if "extra_mirror" in cmdline: + bot_name = "extra_mirror.py" +else: + bot_name = "zephyr_mirror.py" +proc = subprocess.Popen(['pgrep', '-U', os.environ["USER"], "-f", bot_name], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, _err_unused = proc.communicate()