code: def _run_services(self, pants_services):
      
      if not pants_services.services:
        self._logger.critical('no services to run, bailing!')
        return
  
      service_thread_map = {service: self._make_thread(service)
                            for service in pants_services.services}
  
      # Start services.
      for service, service_thread in service_thread_map.items():
        self._logger.info('starting service {}'.format(service))
        try:
          service_thread.start()
        except (RuntimeError, FSEventService.ServiceError):
          self.shutdown(service_thread_map)
          raise PantsDaemon.StartupFailure('service {} failed to start, shutting down!'.format(service))
  
      # Once all services are started, write our pid.
      self.write_pid()
      self.write_metadata_by_name('pantsd', self.FINGERPRINT_KEY, ensure_text(self.options_fingerprint))
  
      # Monitor services.
      while not self.is_killed:
        for service, service_thread in service_thread_map.items():
          if not service_thread.is_alive():
            self.shutdown(service_thread_map)
            raise PantsDaemon.RuntimeFailure('service failure for {}, shutting down!'.format(service))
          else:
            # Avoid excessive CPU utilization.
            service_thread.join(self.JOIN_TIMEOUT_SECONDS)
docs: Service runner main loop.