summaryrefslogtreecommitdiff
path: root/libpod/oci_conmon_linux.go
diff options
context:
space:
mode:
authorwuhua.ck <wuhua.ck@alibaba-inc.com>2021-04-15 22:36:50 +0800
committerchenkang <kongchen28@gmail.com>2021-04-16 13:43:14 +0800
commit8fbe06b8cbd8e3bc425d83130d562eb0c19f309b (patch)
treedb52b4259b92ad6fb30bbe3ff07d01eb7ce208ef /libpod/oci_conmon_linux.go
parent373f15f617db6731c58776c1766a4cf2c74b22b9 (diff)
downloadpodman-8fbe06b8cbd8e3bc425d83130d562eb0c19f309b.tar.gz
podman-8fbe06b8cbd8e3bc425d83130d562eb0c19f309b.tar.bz2
podman-8fbe06b8cbd8e3bc425d83130d562eb0c19f309b.zip
add flag "--pidfile" for podman create/run
Signed-off-by: chenkang <kongchen28@gmail.com>
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r--libpod/oci_conmon_linux.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 5e8ed12e7..c5735d114 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -1025,7 +1025,12 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
}
}
- args := r.sharedConmonArgs(ctr, ctr.ID(), ctr.bundlePath(), filepath.Join(ctr.state.RunDir, "pidfile"), ctr.LogPath(), r.exitsDir, ociLog, ctr.LogDriver(), logTag)
+ pidfile := ctr.config.PidFile
+ if pidfile == "" {
+ pidfile = filepath.Join(ctr.state.RunDir, "pidfile")
+ }
+
+ args := r.sharedConmonArgs(ctr, ctr.ID(), ctr.bundlePath(), pidfile, ctr.LogPath(), r.exitsDir, ociLog, ctr.LogDriver(), logTag)
if ctr.config.Spec.Process.Terminal {
args = append(args, "-t")