code: def signal_stop(self, mode):
          
          if self.is_single_user:
              logger.warning("Cannot stop server; single-user server is running (PID: {0})".format(self.pid))
              return False
          try:
              self.send_signal(STOP_SIGNALS[mode])
          except psutil.NoSuchProcess:
              return True
          except psutil.AccessDenied as e:
              logger.warning("Could not send stop signal to PostgreSQL (error: {0})".format(e))
              return False
  
          return None
docs: Signal postmaster process to stop
  
          :returns None if signaled, True if process is already gone, False if error