def _exec(self, detach=True):
"""
daemonize and exec main()
"""
kwargs = {
'pidfile': self.pidfile,
'working_directory': self.home_dir,
}
# FIXME - doesn't work
if not detach:
kwargs.update({
'detach_process': False,
'files_preserve': [0,1,2],
'stdout': sys.stdout,
'stderr': sys.stderr,
})
ctx = daemon.DaemonContext(**kwargs)
with ctx:
self._main()
评论列表
文章目录