code: def shutdown(self, service_thread_map):
      
      with self._services.lifecycle_lock:
        for service, service_thread in service_thread_map.items():
          self._logger.info('terminating pantsd service: {}'.format(service))
          service.terminate()
          service_thread.join(self.JOIN_TIMEOUT_SECONDS)
        self._logger.info('terminating pantsd')
        self._kill_switch.set()
docs: Gracefully terminate all services and kill the main PantsDaemon loop.