aboutsummaryrefslogtreecommitdiff
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-08 15:02:28 -0500
commite95f4aa3b0715f87c55a60aa9bf395cbdfc2f3d9 (patch)
treeda0841b6ffa50b65e642d4c841a5fffa6aa0e217
parent53e70e268a849fcba2301f340544a57401337056 (diff)
downloadpodman-e95f4aa3b0715f87c55a60aa9bf395cbdfc2f3d9.tar.gz
podman-e95f4aa3b0715f87c55a60aa9bf395cbdfc2f3d9.tar.bz2
podman-e95f4aa3b0715f87c55a60aa9bf395cbdfc2f3d9.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 0284dde2f..89ca59bbb 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -393,7 +393,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)