(s Subsystem, path Path, resources *specs.LinuxResources)
| 248 | } |
| 249 | |
| 250 | func initializeSubsystem(s Subsystem, path Path, resources *specs.LinuxResources) error { |
| 251 | if c, ok := s.(creator); ok { |
| 252 | p, err := path(s.Name()) |
| 253 | if err != nil { |
| 254 | return err |
| 255 | } |
| 256 | if err := c.Create(p, resources); err != nil { |
| 257 | return err |
| 258 | } |
| 259 | } else if c, ok := s.(pather); ok { |
| 260 | p, err := path(s.Name()) |
| 261 | if err != nil { |
| 262 | return err |
| 263 | } |
| 264 | // do the default create if the group does not have a custom one |
| 265 | if err := os.MkdirAll(c.Path(p), defaultDirPerm); err != nil { |
| 266 | return err |
| 267 | } |
| 268 | } |
| 269 | return nil |
| 270 | } |
| 271 | |
| 272 | func cleanPath(path string) string { |
| 273 | if path == "" { |
searching dependent graphs…