mirror of
https://github.com/containers/podman
synced 2024-10-21 01:34:37 +00:00
Allow podman stop
to be run on Stopping containers
This allows you to stop a container after a `podman stop` process started, but did not finish, stopping the container (probably an ignored stop signal, with no time to SIGKILL?). This is a very narrow case, but once you're in it the only way to recover is a `podman rm -f` of the container or extensive manual remediation (you'd have to kill the container yourself, manually, and then force a `podman ps --all --sync` to update its status from the OCI runtime). [NO NEW TESTS NEEDED] I have no idea how to verify this one - we need to test that it actually started *during* the other stop command, and that's nontrivial. Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
parent
8bcc086b1b
commit
e1089e89d7
|
@ -184,7 +184,7 @@ func (c *Container) StopWithTimeout(timeout uint) error {
|
|||
return define.ErrCtrStopped
|
||||
}
|
||||
|
||||
if !c.ensureState(define.ContainerStateCreated, define.ContainerStateRunning) {
|
||||
if !c.ensureState(define.ContainerStateCreated, define.ContainerStateRunning, define.ContainerStateStopping) {
|
||||
return errors.Wrapf(define.ErrCtrStateInvalid, "can only stop created or running containers. %s is in state %s", c.ID(), c.state.State.String())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue