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)
This commit is contained in:
Tianon Gravi 2013-04-23 01:09:29 -06:00
parent 95e066d24f
commit e413340723
1 changed files with 1 additions and 1 deletions

View File

@ -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 {