diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2021-10-27 09:44:54 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2021-10-27 11:24:50 +0200 |
commit | 6b3b0a17c625bdf71b0ec8b783b288886d8e48d7 (patch) | |
tree | d3d83ff808ea8743761766ebcb3e52ac3bd72d2d /libpod | |
parent | 825889cc7e5c980fb09971a05983bc42ac503ba4 (diff) | |
download | podman-6b3b0a17c625bdf71b0ec8b783b288886d8e48d7.tar.gz podman-6b3b0a17c625bdf71b0ec8b783b288886d8e48d7.tar.bz2 podman-6b3b0a17c625bdf71b0ec8b783b288886d8e48d7.zip |
runtime: check for pause pid existence
check that the pause pid exists before trying to move it to a separate
scope.
Closes: https://github.com/containers/podman/issues/12065
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 855f3a9f9..950ac65eb 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -543,7 +543,11 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) { return err } if became { - utils.MovePauseProcessToScope(pausePid) + // Check if the pause process was created. If it was created, then + // move it to its own systemd scope. + if _, err = os.Stat(pausePid); err == nil { + utils.MovePauseProcessToScope(pausePid) + } os.Exit(ret) } } |