diff options
author | Matthew Heon <mheon@redhat.com> | 2021-10-06 11:17:43 -0400 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-10-06 11:19:32 -0400 |
commit | 8bd9f58d1d0db76406dca53907095648f4091f9f (patch) | |
tree | e01204cca664c9e2ca860d12fbcbbbb9faa942de /libpod/oci_conmon_linux.go | |
parent | e1089e89d7b8f5204ccb226934e46df736af4925 (diff) | |
download | podman-8bd9f58d1d0db76406dca53907095648f4091f9f.tar.gz podman-8bd9f58d1d0db76406dca53907095648f4091f9f.tar.bz2 podman-8bd9f58d1d0db76406dca53907095648f4091f9f.zip |
Ensure `podman ps --sync` functions
The backend for `ps --sync` has been nonfunctional for a long
while now - probably since v2.0. It's questionable how useful the
flag is in modern Podman (the original case it was intended to
catch, Conmon gone via SIGKILL, should be handled now via pinging
the process with a signal to ensure it's still alive) but having
the ability to force a refresh of container state from the OCI
runtime is still useful.
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r-- | libpod/oci_conmon_linux.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index 71a7b29fa..fa31c7461 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -351,6 +351,12 @@ func (r *ConmonOCIRuntime) UpdateContainerStatus(ctr *Container) error { return ctr.handleExitFile(exitFile, fi) } + // Handle ContainerStateStopping - keep it unless the container + // transitioned to no longer running. + if oldState == define.ContainerStateStopping && (ctr.state.State == define.ContainerStatePaused || ctr.state.State == define.ContainerStateRunning) { + ctr.state.State = define.ContainerStateStopping + } + return nil } |