Skip to content

Commit fef7250

Browse files
committedFeb 18, 2016
ctlmgr/gui/master: start subprocesses in new pgroup
This only makes a difference on POSIX. It prevents subprocesses from receiving the signals that the parent receives. For ctlmgr and master is cuts down on spam on the console (KeyboardInterrupt tracebacks from all controllers) and enforces that proper termination is followed. This does not help if the parent gets SIGKILL (subprocesses may linger).
1 parent 4bd5a55 commit fef7250

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed
 

‎artiq/devices/ctlmgr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async def launcher(self):
8686
self.process = await asyncio.create_subprocess_exec(
8787
*shlex.split(self.command),
8888
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
89-
env=env)
89+
env=env, start_new_session=True)
9090
asyncio.ensure_future(
9191
LogParser(self._get_log_source).stream_task(
9292
self.process.stdout))

‎artiq/gui/applets.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ async def start(self):
116116
)
117117
logger.debug("starting command %s for %s", command, self.applet_name)
118118
try:
119-
await self.ipc.create_subprocess(*shlex.split(command))
119+
await self.ipc.create_subprocess(*shlex.split(command),
120+
start_new_session=True)
120121
except:
121122
logger.warning("Applet %s failed to start", self.applet_name,
122123
exc_info=True)

‎artiq/master/worker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async def _create_process(self, log_level):
8787
sys.executable, "-m", "artiq.master.worker_impl",
8888
self.ipc.get_address(), str(log_level),
8989
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
90-
env=env)
90+
env=env, start_new_session=True)
9191
asyncio.ensure_future(
9292
LogParser(self._get_log_source).stream_task(
9393
self.ipc.process.stdout))

0 commit comments

Comments
 (0)
Please sign in to comment.