From e413340723871ad2d7a03822ca06993ee3c0a4bc Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 23 Apr 2013 01:09:29 -0600 Subject: [PATCH] Update FindCgroupMountpoint to be more forgiving On Gentoo, the memory cgroup is mounted at /sys/fs/cgroup/memory, but the mount line looks like the following: memory on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) (note that the first word on the line is "memory", not "cgroup", but the other essentials are there, namely the type of cgroup and the memory mount option) --- utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.go b/utils.go index 5974b7df3b..8bcf38367b 100644 --- a/utils.go +++ b/utils.go @@ -442,7 +442,7 @@ func FindCgroupMountpoint(cgroupType string) (string, error) { return "", err } - reg := regexp.MustCompile(`^cgroup on (.*) type cgroup \(.*` + cgroupType + `[,\)]`) + reg := regexp.MustCompile(`^.* on (.*) type cgroup \(.*` + cgroupType + `[,\)]`) for _, line := range strings.Split(string(output), "\n") { r := reg.FindStringSubmatch(line) if len(r) == 2 {