code: func shutdownDaemon(d *daemon.Daemon) {
  	shutdownTimeout := d.ShutdownTimeout()
  	ch := make(chan struct{})
  	go func() {
  		d.Shutdown()
  		close(ch)
  	}()
  	if shutdownTimeout < 0 {
  		<-ch
  		logrus.Debug("Clean shutdown succeeded")
  		return
  	}
  	select {
  	case <-ch:
  		logrus.Debug("Clean shutdown succeeded")
  	case <-time.After(time.Duration(shutdownTimeout) * time.Second):
  		logrus.Error("Force shutdown daemon")
  	}
  }
docs: // shutdownDaemon just wraps daemon.Shutdown() to handle a timeout in case
  // d.Shutdown() is waiting too long to kill container or worst it's
  // blocked there