code: def _exec(self, detach=True):
          
          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()
docs: daemonize and exec main()