2016-01-27 06:22:25 +00:00
|
|
|
// +build linux
|
|
|
|
|
|
|
|
package fingerprint
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/opencontainers/runc/libcontainer/cgroups"
|
|
|
|
)
|
|
|
|
|
2016-01-29 13:34:29 +00:00
|
|
|
// FindCgroupMountpointDir is used to find the cgroup mount point on a Linux
|
|
|
|
// system.
|
2016-01-27 06:22:25 +00:00
|
|
|
func FindCgroupMountpointDir() (string, error) {
|
|
|
|
mount, err := cgroups.FindCgroupMountpointDir()
|
|
|
|
if err != nil {
|
|
|
|
switch e := err.(type) {
|
|
|
|
case *cgroups.NotFoundError:
|
|
|
|
// It's okay if the mount point is not discovered
|
|
|
|
return "", nil
|
|
|
|
default:
|
|
|
|
// All other errors are passed back as is
|
|
|
|
return "", e
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return mount, nil
|
|
|
|
}
|