code: func (m *Command) Wait() error {
  	// First SIGKILL causes server to shut down gracefully.
  	c := make(chan os.Signal, 2)
  	signal.Notify(c, os.Interrupt, syscall.SIGTERM)
  	select {
  	case sig := <-c:
  		m.logger.Printf("received signal '%s', gracefully shutting down...\n", sig.String())
  
  		// Second signal causes a hard shutdown.
  		go func() { <-c; os.Exit(1) }()
  		return errors.Wrap(m.Close(), "closing command")
  	case <-m.done:
  		m.logger.Printf("server closed externally")
  		return nil
  	}
  }
docs: // Wait waits for the server to be closed or interrupted.