summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-02 09:37:30 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-02 16:03:02 +0000
commit1a48c426c931ab7c98233afbabb21b01276136ec (patch)
treebc55c1d64ec17211d4b87e0e082188fa0425c06f
parentef4035e208f1431745cd044adb4b789fab3a98b6 (diff)
downloadpodman-1a48c426c931ab7c98233afbabb21b01276136ec.tar.gz
podman-1a48c426c931ab7c98233afbabb21b01276136ec.tar.bz2
podman-1a48c426c931ab7c98233afbabb21b01276136ec.zip
Extend search path for conmon
Adding /usr/libexec/crio/conmon to the list of places to look for conmon. Signed-off-by: baude <bbaude@redhat.com> Closes: #172 Approved by: rhatdan
-rw-r--r--libpod/runtime.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 59d7f7e3c..cb1e8f531 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -63,7 +63,7 @@ var (
ImageDefaultTransport: DefaultTransport,
InMemoryState: false,
RuntimePath: "/usr/bin/runc",
- ConmonPath: "/usr/local/libexec/crio/conmon",
+ ConmonPath: findConmonPath(),
ConmonEnvVars: []string{
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
},
@@ -79,6 +79,15 @@ var (
}
)
+func findConmonPath() string {
+ path := "/usr/local/libexec/crio/conmon"
+ _, err := os.Stat(path)
+ if err != nil {
+ path = "/usr/libexec/crio/conmon"
+ }
+ return path
+}
+
// NewRuntime creates a new container runtime
// Options can be passed to override the default configuration for the runtime
func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {