summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-08 23:39:42 +0200
committerGitHub <noreply@github.com>2019-07-08 23:39:42 +0200
commitfce2e6577e8a6be153c45f4d732fb0fcc3c95a4a (patch)
tree62a3d6ec343bba742e159a5514e8a64e6e8baf99 /pkg/adapter/containers.go
parent8d37c2073f774d7f7e708cdb8c24f07c87e83587 (diff)
parent2bfade4391bb6d247ddab2d129d0529471c17063 (diff)
downloadpodman-fce2e6577e8a6be153c45f4d732fb0fcc3c95a4a.tar.gz
podman-fce2e6577e8a6be153c45f4d732fb0fcc3c95a4a.tar.bz2
podman-fce2e6577e8a6be153c45f4d732fb0fcc3c95a4a.zip
Merge pull request #3497 from QazerLab/bugfix/systemd-generate-pidfile
Use conmon pidfile in generated systemd unit as PIDFile.
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r--pkg/adapter/containers.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index 10720886b..0ea89a72c 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -1058,7 +1058,14 @@ func (r *LocalRuntime) GenerateSystemd(c *cliconfig.GenerateSystemdValues) (stri
if c.Name {
name = ctr.Name()
}
- return systemdgen.CreateSystemdUnitAsString(name, ctr.ID(), c.RestartPolicy, ctr.Config().StaticDir, timeout)
+
+ config := ctr.Config()
+ conmonPidFile := config.ConmonPidFile
+ if conmonPidFile == "" {
+ return "", errors.Errorf("conmon PID file path is empty, try to recreate the container with --conmon-pidfile flag")
+ }
+
+ return systemdgen.CreateSystemdUnitAsString(name, ctr.ID(), c.RestartPolicy, conmonPidFile, timeout)
}
// GetNamespaces returns namespace information about a container for PS