def start(self):
"""
Start the process.
"""
preexec = None
if hasattr(self, '_process_group_leader'):
# This probably needs some kind of syncronization...
if self._process_group_leader is ...:
preexec = os.setpgrp
else:
pgid = self._process_group_leader.pid
def preexec():
os.setpgid(0, pgid)
self._proc = subprocess.Popen(
# What to execute
self.cmd,
preexec_fn=preexec,
# What IO it has
stdin=self.stdin, stdout=self.stdout, stderr=self.stderr,
# Environment it executes in
cwd=self.cwd, env=self.environ,
)
评论列表
文章目录