github.com/ranjib/nomad@v0.1.1-0.20160225204057-97751b02f70b/client/fingerprint/cgroup_linux.go (about)

     1  // +build linux
     2  
     3  package fingerprint
     4  
     5  import (
     6  	"github.com/opencontainers/runc/libcontainer/cgroups"
     7  )
     8  
     9  // FindCgroupMountpointDir is used to find the cgroup mount point on a Linux
    10  // system.
    11  func FindCgroupMountpointDir() (string, error) {
    12  	mount, err := cgroups.FindCgroupMountpointDir()
    13  	if err != nil {
    14  		switch e := err.(type) {
    15  		case *cgroups.NotFoundError:
    16  			// It's okay if the mount point is not discovered
    17  			return "", nil
    18  		default:
    19  			// All other errors are passed back as is
    20  			return "", e
    21  		}
    22  	}
    23  	return mount, nil
    24  }