code: func interruptListener() <-chan struct{} {
  	c := make(chan struct{})
  	go func() {
  		interruptChannel := make(chan os.Signal, 1)
  		signal.Notify(interruptChannel, interruptSignals...)
  
  		// Listen for initial shutdown signal and close the returned
  		// channel to notify the caller.
  		select {
  		case sig := <-interruptChannel:
  			btcdLog.Infof("Received signal (%s).  Shutting down...",
  				sig)
  
  		case <-shutdownRequestChannel:
  			btcdLog.Info("Shutdown requested.  Shutting down...")
  		}
  		close(c)
  
  		// Listen for repeated signals and display a message so the user
  		// knows the shutdown is in progress and the process is not
  		// hung.
  		for {
  			select {
  			case sig := <-interruptChannel:
  				btcdLog.Infof("Received signal (%s).  Already "+
  					"shutting down...", sig)
  
  			case <-shutdownRequestChannel:
  				btcdLog.Info("Shutdown requested.  Already " +
  					"shutting down...")
  			}
  		}
  	}()
  
  	return c
  }
docs: // interruptListener listens for OS Signals such as SIGINT (Ctrl+C) and shutdown
  // requests from shutdownRequestChannel.  It returns a channel that is closed
  // when either signal is received.