code: def daemonize(self) -> None:
          
          if os.fork() == 0:
              pid = os.fork()
              if pid == 0:
                  try:
                      # Closing the sys.stdout and stderr file descriptors here causes
                      # the program to crash when attempting to log.
                      os.close(sys.stdout.fileno())
                      os.close(sys.stderr.fileno())
                      self._run()
                      sys.exit(0)
                  except Exception as exception:
                      LOG.info("Not running %s due to %s", self._name, str(exception))
                      sys.exit(1)
              else:
                  sys.exit(0)
docs: We double-fork here to detach the daemon process from the parent.
             If we were to just fork the child as a daemon, we'd have to worry about the
             parent process exiting zombifying the daemon.