ethminer.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:toshi-services-lib 作者: toshiapp 项目源码 文件源码
def start(self):
        if self.child_process:
            return  # already started

        self.prestart()

        logger = open(os.path.join(self.base_dir, '%s.log' % self.name), 'wt')
        try:
            command = self.get_server_commandline()
            flags = 0
            if os.name == 'nt':
                flags |= subprocess.CREATE_NEW_PROCESS_GROUP
            custom_env = os.environ.copy()
            custom_env["HOME"] = self.home
            kwargs = {'env': custom_env, 'creationflags': flags}
            if not self.debug:
                kwargs.update({'stdout': logger, 'stderr': logger})
            self.child_process = subprocess.Popen(command, **kwargs)
        except Exception as exc:
            raise RuntimeError('failed to launch %s: %r' % (self.name, exc))
        else:
            try:
                self.wait_booting()
                self.poststart()
            except:
                self.stop()
                raise
        finally:
            logger.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号