summaryrefslogtreecommitdiff
path: root/cmd/podman/run.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2019-02-12 12:57:11 -0500
committerMatthew Heon <mheon@redhat.com>2019-02-12 12:57:11 -0500
commit19a03976f73d21a821a07ae5f24250a4ceaee33a (patch)
tree8021d67f20528bd6c4bb79035d6e124b53b2b0db /cmd/podman/run.go
parentb6775d5d22d463e4d92d6358ccd48dab6f8a1862 (diff)
downloadpodman-19a03976f73d21a821a07ae5f24250a4ceaee33a.tar.gz
podman-19a03976f73d21a821a07ae5f24250a4ceaee33a.tar.bz2
podman-19a03976f73d21a821a07ae5f24250a4ceaee33a.zip
Retain a copy of container exit file on cleanup
When cleaning up containers, we presently remove the exit file created by Conmon, to ensure that if we restart the container, we won't have conflicts when Conmon tries writing a new exit file. Unfortunately, we need to retain that exit file (at least until we get a workable events system), so we can read it in cases where the container has been removed before 'podman run' can read its exit code. So instead of removing it, rename it, so there's no conflict with Conmon, and we can still read it later. Fixes: #1640 Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'cmd/podman/run.go')
-rw-r--r--cmd/podman/run.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go
index 6002578ff..86dc02dea 100644
--- a/cmd/podman/run.go
+++ b/cmd/podman/run.go
@@ -160,7 +160,7 @@ func runCmd(c *cliconfig.RunValues) error {
// Read a container's exit file
func readExitFile(runtimeTmp, ctrID string) (int, error) {
- exitFile := filepath.Join(runtimeTmp, "exits", ctrID)
+ exitFile := filepath.Join(runtimeTmp, "exits", fmt.Sprintf("%s-old", ctrID))
logrus.Debugf("Attempting to read container %s exit code from file %s", ctrID, exitFile)