summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-02-05 15:37:56 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-02-05 15:37:56 -0500
commit3c52accbc9c290286f78334765f8b1b0c38140af (patch)
tree97c66391e95c10b7d9c187cf740aed473a97c51d
parent3554bfce98bc643bd4724340bf2abbaa6373e70c (diff)
downloadpodman-3c52accbc9c290286f78334765f8b1b0c38140af.tar.gz
podman-3c52accbc9c290286f78334765f8b1b0c38140af.tar.bz2
podman-3c52accbc9c290286f78334765f8b1b0c38140af.zip
Preserve exited state across reboot
Instead of unconditionally resetting to ContainerStateConfigured after a reboot, allow containers in the Exited state to remain there, preserving their exit code in podman ps after a reboot. This does not affect the ability to use and restart containers after a reboot, as the Exited state can be used (mostly) interchangeably with Configured for starting and managing containers. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
-rw-r--r--libpod/container_internal.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 39c1501da..b0dcc853e 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -392,7 +392,9 @@ func resetState(state *ContainerState) error {
state.PID = 0
state.Mountpoint = ""
state.Mounted = false
- state.State = ContainerStateConfigured
+ if state.State != ContainerStateExited {
+ state.State = ContainerStateConfigured
+ }
state.ExecSessions = make(map[string]*ExecSession)
state.NetworkStatus = nil
state.BindMounts = make(map[string]string)