From abb7d9f911a8a07787c44c80c5e0d8e0def0c8cd Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 8 Feb 2015 12:15:22 +0800 Subject: [PATCH] ctlmgr: catch create_subprocess_exec errors and retry --- artiq/frontend/artiq_ctlmgr.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/artiq/frontend/artiq_ctlmgr.py b/artiq/frontend/artiq_ctlmgr.py index 437ab0b04..cc397aef7 100755 --- a/artiq/frontend/artiq_ctlmgr.py +++ b/artiq/frontend/artiq_ctlmgr.py @@ -47,9 +47,13 @@ class Controller: while True: logger.info("Starting controller %s with command: %s", name, command) - process = yield from asyncio.create_subprocess_exec(*command.split()) - yield from asyncio.shield(process.wait()) - logger.warning("Controller %s exited", name) + try: + process = yield from asyncio.create_subprocess_exec(*command.split()) + yield from asyncio.shield(process.wait()) + except FileNotFoundError: + logger.warning("Controller %s failed to start", name) + else: + logger.warning("Controller %s exited", name) logger.warning("Restarting in %.1f seconds", retry) yield from asyncio.sleep(retry) except asyncio.CancelledError: