Implement container signal

This commit is contained in:
Michael Crosby
2015-11-10 13:44:35 -08:00
parent a2ddcc2232
commit d34d482a5f
7 changed files with 119 additions and 14 deletions

View File

@@ -92,6 +92,24 @@ func (s *Supervisor) Start(events chan Event) error {
e.Containers = append(e.Containers, c)
}
e.Err <- nil
case *SignalEvent:
container, ok := s.containers[e.ID]
if !ok {
e.Err <- ErrContainerNotFound
continue
}
processes, err := container.Processes()
if err != nil {
e.Err <- err
continue
}
for _, p := range processes {
if p.Pid() == e.Pid {
e.Err <- p.Signal(e.Signal)
continue
}
}
e.Err <- ErrProcessNotFound
}
}
}()