summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-09-12 14:29:41 -0500
committerbaude <bbaude@redhat.com>2019-09-12 14:30:46 -0500
commit7b68cd0b3d45c3d7e01b6134abaa0ece44518625 (patch)
tree1bbce1e56eb809a4dda0f3c2b3bf7bffdfa2c0bb /libpod
parentaf8fedcc78674d71d43ca3000438c42b7b6b6994 (diff)
downloadpodman-7b68cd0b3d45c3d7e01b6134abaa0ece44518625.tar.gz
podman-7b68cd0b3d45c3d7e01b6134abaa0ece44518625.tar.bz2
podman-7b68cd0b3d45c3d7e01b6134abaa0ece44518625.zip
clean up after healthcheck execs
when executing a healthcheck, we were not cleaning up after exec's use of a socket. we now remove the socket file and ignore if for reason it does not exist. Fixes: #3962 Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index ac565fdad..0b5a8b946 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -163,7 +163,15 @@ func (c *Container) createExecBundle(sessionID string) (err error) {
// cleanup an exec session after its done
func (c *Container) cleanupExecBundle(sessionID string) error {
- return os.RemoveAll(c.execBundlePath(sessionID))
+ if err := os.RemoveAll(c.execBundlePath(sessionID)); err != nil && !os.IsNotExist(err) {
+ return err
+ }
+ // Clean up the sockets dir. Issue #3962
+ // Also ignore if it doesn't exist for some reason; hence the conditional return below
+ if err := os.RemoveAll(filepath.Join(c.ociRuntime.socketsDir, sessionID)); err != nil && !os.IsNotExist(err) {
+ return err
+ }
+ return nil
}
// the path to a containers exec session bundle