func shutdownDaemon(d *daemon.Daemon, timeout time.Duration) {
	ch := make(chan struct{})
	go func() {
		d.Shutdown()
		close(ch)
	}()
	select {
	case <-ch:
		logrus.Debug("Clean shutdown succeeded")
	case <-time.After(timeout * time.Second):
		logrus.Error("Force shutdown daemon")
	}
}
// 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
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
// 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
func shutdownDaemon(d *daemon.Daemon, timeout time.Duration) {
	ch := make(chan struct{})
	go func() {
		d.Shutdown()
		close(ch)
	}()
	select {
	case <-ch:
		logrus.Debug("Clean shutdown succeeded")
	case <-time.After(timeout * time.Second):
		logrus.Error("Force shutdown daemon")
	}
}
func shutdownDaemon ( d * daemon . Daemon , timeout time . Duration ) { ch := make ( chan struct { } ) go func ( ) { d . Shutdown ( ) close ( ch ) } ( ) select { case <- ch : logrus . Debug ( " " ) case <- time . After ( timeout * time . Second ) : logrus . Error ( " " ) } }
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
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