Exemple #1
0
// callback ensures that the container's state is properly updated after we
// received ack from the execution drivers
func (m *containerMonitor) callback(command *execdriver.Command) {
	if command.Tty {
		// The callback is called after the process Start()
		// so we are in the parent process. In TTY mode, stdin/out/err is the PtySlace
		// which we close here.
		if c, ok := command.Stdout.(io.Closer); ok {
			c.Close()
		}
	}

	m.container.State.SetRunning(command.Pid())

	if m.startSignal != nil {
		// signal that the process has started
		close(m.startSignal)
		m.startSignal = nil
	}

	if err := m.container.ToDisk(); err != nil {
		log.Debugf("%s", err)
	}
}