defaults returns all known groups
(root string)
| 34 | |
| 35 | // defaults returns all known groups |
| 36 | func defaults(root string) ([]Subsystem, error) { |
| 37 | h, err := NewHugetlb(root) |
| 38 | if err != nil && !os.IsNotExist(err) { |
| 39 | return nil, err |
| 40 | } |
| 41 | s := []Subsystem{ |
| 42 | NewNamed(root, "systemd"), |
| 43 | NewFreezer(root), |
| 44 | NewPids(root), |
| 45 | NewNetCls(root), |
| 46 | NewNetPrio(root), |
| 47 | NewPerfEvent(root), |
| 48 | NewCpuset(root), |
| 49 | NewCpu(root), |
| 50 | NewCpuacct(root), |
| 51 | NewMemory(root), |
| 52 | NewBlkio(root), |
| 53 | NewRdma(root), |
| 54 | } |
| 55 | // only add the devices cgroup if we are not in a user namespace |
| 56 | // because modifications are not allowed |
| 57 | if !userns.RunningInUserNS() { |
| 58 | s = append(s, NewDevices(root)) |
| 59 | } |
| 60 | // add the hugetlb cgroup if error wasn't due to missing hugetlb |
| 61 | // cgroup support on the host |
| 62 | if err == nil { |
| 63 | s = append(s, h) |
| 64 | } |
| 65 | return s, nil |
| 66 | } |
| 67 | |
| 68 | // remove will remove a cgroup path handling EAGAIN and EBUSY errors and |
| 69 | // retrying the remove after a exp timeout |
searching dependent graphs…