summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorchenkang <kongchen28@gmail.com>2021-04-18 00:02:50 +0800
committerchenkang <kongchen28@gmail.com>2021-04-18 00:02:50 +0800
commita35e16c23456a8fba8d2f627ac64f647aa6f0722 (patch)
tree1c9c412ff8f890b3e60de68f45c5745b67c92812 /libpod
parenta1002beb78e3a63c0704f5cd8f6ff6556e60bb2f (diff)
downloadpodman-a35e16c23456a8fba8d2f627ac64f647aa6f0722.tar.gz
podman-a35e16c23456a8fba8d2f627ac64f647aa6f0722.tar.bz2
podman-a35e16c23456a8fba8d2f627ac64f647aa6f0722.zip
support pidfile on container restore
Signed-off-by: chenkang <kongchen28@gmail.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime_ctr.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 6290479a8..0acf88cbc 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -69,6 +69,13 @@ func (r *Runtime) RestoreContainer(ctx context.Context, rSpec *spec.Spec, config
ctr.config.ConmonPidFile = ""
}
+ // If the path to PidFile starts with the default value (RunRoot), then
+ // the user has not specified '--pidfile' during run or create (probably).
+ // In that case reset PidFile to be set to the default value later.
+ if strings.HasPrefix(ctr.config.PidFile, r.storageConfig.RunRoot) {
+ ctr.config.PidFile = ""
+ }
+
return r.setupContainer(ctx, ctr)
}