diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-05-20 15:29:24 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-05-20 16:11:05 -0400 |
commit | 6b9e9610d8ef380d32a682d058157db0f08dd873 (patch) | |
tree | ffd1f83437eb6d7e111c91b2036dfd34ff6c78d3 /libpod/runtime_ctr.go | |
parent | 5ec56dc79093e52abd8e72913aa62932bf12ba6a (diff) | |
download | podman-6b9e9610d8ef380d32a682d058157db0f08dd873.tar.gz podman-6b9e9610d8ef380d32a682d058157db0f08dd873.tar.bz2 podman-6b9e9610d8ef380d32a682d058157db0f08dd873.zip |
Enable cleanup processes for detached exec
The cleanup command creation logic is made public as part of this
and wired such that we can call it both within SpecGen (to make
container exit commands) and from the ABI detached exec handler.
Exit commands are presently only used for detached exec, but
theoretically could be turned on for all exec sessions if we
wanted (I'm declining to do this because of potential overhead).
I also forgot to copy the exit command from the exec config into
the ExecOptions struct used by the OCI runtime, so it was not
being added.
There are also two significant bugfixes for exec in here. One is
for updating the status of running exec sessions - this was
always failing as I had coded it to remove the exit file *before*
reading it, instead of after (oops). The second was that removing
a running exec session would always fail because I inverted the
check to see if it was running.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index c670822a0..655b42e51 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -390,6 +390,8 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool, } } + logrus.Debugf("Removing container %s", c.ID()) + // We need to lock the pod before we lock the container. // To avoid races around removing a container and the pod it is in. // Don't need to do this in pod removal case - we're evicting the entire |