Make the restart tool try again if it fails to restart.

(imported from commit 216dcdcaa096c26e26b385029d62d0310349a6c9)
This commit is contained in:
Tim Abbott 2012-10-12 15:13:14 -04:00
parent e7af4a918b
commit 58647ef04c

View file

@ -136,7 +136,13 @@ def update_subscriptions_from_humbug():
def maybe_restart_mirroring_script(): def maybe_restart_mirroring_script():
if os.stat("/mit/tabbott/for_friends/restart_stamp").st_mtime > start_time: if os.stat("/mit/tabbott/for_friends/restart_stamp").st_mtime > start_time:
print "zephyr mirroring script has been updated; restarting..." print "zephyr mirroring script has been updated; restarting..."
while True:
try:
os.execvp("/mit/tabbott/for_friends/zephyr_mirror.py", sys.argv) os.execvp("/mit/tabbott/for_friends/zephyr_mirror.py", sys.argv)
except:
print "Error restarting, trying again."
traceback.print_exc()
time.sleep(10)
def process_loop(log): def process_loop(log):
sleep_count = 0 sleep_count = 0