reaper: Return an error if exit status is not 0

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2017-09-01 09:43:04 -07:00
parent 92772bd471
commit a6fb9bc111
No known key found for this signature in database
GPG Key ID: 40CF16616B361216

View File

@ -90,6 +90,9 @@ func (m *Monitor) Wait(c *exec.Cmd, ec chan runc.Exit) (int, error) {
// make sure we flush all IO
c.Wait()
m.Unsubscribe(ec)
if e.Status != 0 {
return e.Status, errors.New("unsucessful command")
}
return e.Status, nil
}
}