code: func (s *Server) Supervise() {
  	sd, err := s.mon.Monitor(s.hrt, s.killc)
  	if sd {
  		log.Infof("Server monitor triggered: told to shut down")
  	} else {
  		log.Errorf("Server monitor triggered: %v", err)
  	}
  	close(s.stopc)
  	done := make(chan struct{})
  	go func() {
  		s.wg.Wait()
  		close(done)
  	}()
  	select {
  	case <-done:
  	case <-time.After(shutdownTimeout):
  		log.Errorf("Timed out waiting for server to shut down. Panicking the server without cleanup.")
  		panic("Failed server shutdown. Panic")
  	}
  	if !sd {
  		log.Infof("Restarting server")
  		s.SetRestartServer(true)
  		s.Run()
  		s.SetRestartServer(false)
  	}
  }
docs: // Supervise monitors the life of the Server and coordinates its shutdown.
  // A shutdown occurs when the monitor returns, either because a health check
  // fails or a user triggers a shutdown. If the shutdown is due to a health
  // check failure, the Server is restarted. Supervise will block shutdown until
  // all components have finished shutting down or a timeout occurs; if this
  // happens, the Server will not automatically be restarted.