summaryrefslogtreecommitdiff
path: root/libpod/oci.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-03-26 20:09:10 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-29 01:34:41 +0000
commitf936b745b66de3cbbdf924a26bb35766afe5acba (patch)
treeb96c47ea63b428f0a7eecf82313e3426eabd3ab1 /libpod/oci.go
parentecda694a92242e6e6921d42b52847bb909eb8051 (diff)
downloadpodman-f936b745b66de3cbbdf924a26bb35766afe5acba.tar.gz
podman-f936b745b66de3cbbdf924a26bb35766afe5acba.tar.bz2
podman-f936b745b66de3cbbdf924a26bb35766afe5acba.zip
podman: new option --conmon-pidfile=
so that it is possible to use systemd to automatically restart the container: [Service] Type=forking PIDFile=/run/awesome-service.pid ExecStart=/usr/bin/podman run --conmon-pidfile=/run/awesome-service.pid --name awesome -d IMAGE /usr/bin/do-something ExecStopPost=/usr/bin/podman rm awesome Restart=always Closes: https://github.com/projectatomic/libpod/issues/534 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #549 Approved by: rhatdan
Diffstat (limited to 'libpod/oci.go')
-rw-r--r--libpod/oci.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpod/oci.go b/libpod/oci.go
index 2ea3317d6..049d0817b 100644
--- a/libpod/oci.go
+++ b/libpod/oci.go
@@ -212,6 +212,9 @@ func (r *OCIRuntime) createContainer(ctr *Container, cgroupParent string) (err e
args = append(args, "-p", filepath.Join(ctr.state.RunDir, "pidfile"))
args = append(args, "-l", ctr.LogPath())
args = append(args, "--exit-dir", r.exitsDir)
+ if ctr.config.ConmonPidFile != "" {
+ args = append(args, "--conmon-pidfile", ctr.config.ConmonPidFile)
+ }
args = append(args, "--socket-dir-path", r.socketsDir)
if ctr.config.Spec.Process.Terminal {
args = append(args, "-t")