summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-10-27 09:44:54 +0200
committerMatthew Heon <matthew.heon@pm.me>2021-11-12 11:08:25 -0500
commit246782133cc36e66db0f4facccd7dabcd76a92d5 (patch)
treef36bf79ef420994e7b3e04b9d4769b2c1bfbd754 /libpod
parent0519e7ef87a402a3f22193b49883cfc66812e61a (diff)
downloadpodman-246782133cc36e66db0f4facccd7dabcd76a92d5.tar.gz
podman-246782133cc36e66db0f4facccd7dabcd76a92d5.tar.bz2
podman-246782133cc36e66db0f4facccd7dabcd76a92d5.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.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index c22d87324..a99f55fb3 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -541,7 +541,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)
}
}