summaryrefslogtreecommitdiff
path: root/libpod/oci.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-06-02 14:02:54 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-06-02 15:30:42 -0400
commite0d940463475b907d56aa548401f8ba916cec21b (patch)
tree9f3f8ef1b4b795802885204283b74a9241bd7a3c /libpod/oci.go
parentd10addca6c4eef4a3ab93336d1080eead3784caa (diff)
downloadpodman-e0d940463475b907d56aa548401f8ba916cec21b.tar.gz
podman-e0d940463475b907d56aa548401f8ba916cec21b.tar.bz2
podman-e0d940463475b907d56aa548401f8ba916cec21b.zip
Enable detached exec for remote
The biggest obstacle here was cleanup - we needed a way to remove detached exec sessions after they exited, but there's no way to tell if an exec session will be attached or detached when it's created, and that's when we must add the exit command that would do the removal. The solution was adding a delay to the exit command (5 minutes), which gives sufficient time for attached exec sessions to retrieve the exit code of the session after it exits, but still guarantees that they will be removed, even for detached sessions. This requires Conmon 2.0.17, which has the new `--exit-delay` flag. As part of the exit command rework, we can drop the hack we were using to clean up exec sessions (remove them as part of inspect). This is a lot cleaner, and I'm a lot happier about it. Otherwise, this is just plumbing - we need a bindings call for detached exec, and that needed to be added to the tunnel mode backend for entities. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/oci.go')
-rw-r--r--libpod/oci.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpod/oci.go b/libpod/oci.go
index 7c5218319..684a7ba42 100644
--- a/libpod/oci.go
+++ b/libpod/oci.go
@@ -172,6 +172,9 @@ type ExecOptions struct {
// ExitCommand is a command that will be run after the exec session
// exits.
ExitCommand []string
+ // ExitCommandDelay is a delay (in seconds) between the exec session
+ // exiting, and the exit command being invoked.
+ ExitCommandDelay uint
}
// HTTPAttachStreams informs the HTTPAttach endpoint which of the container's