def shutdown(self) -> None:
        """Shut the daemon down when a SIGTERM is received.

        Shut down the daemon process and the logger thread.
        """
        with self._sigterm_lock:
            self._received_sigterm = True
        self._shutdown()
        self.logger.shutdown()
Shut the daemon down when a SIGTERM is received.

        Shut down the daemon process and the logger thread.
        
patroni/daemon.py