Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #312 from bwester/cgroups
Browse files Browse the repository at this point in the history
Use "cgroup.procs" for cgroup membership
  • Loading branch information
bwester committed Oct 29, 2015
2 parents 8055684 + e6c2a30 commit cba7473
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/p2-exec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func cgEnter(platconf, launchableName, cgroupName string) error {
} else if err != nil {
return util.Errorf("Could not set cgroup parameters: %s", err)
}
return cg.AddPID(cgConfig.Name, os.Getpid())
return cg.AddPID(cgConfig.Name, 0)
}

// generalized code to remove rlimits on both darwin and linux
Expand Down
4 changes: 2 additions & 2 deletions pkg/cgroups/cgroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ func (subsys Subsystems) Write(config Config) error {
}

func (subsys Subsystems) AddPID(name string, pid int) error {
err := appendIntToFile(filepath.Join(subsys.Memory, name, "tasks"), pid)
err := appendIntToFile(filepath.Join(subsys.Memory, name, "cgroup.procs"), pid)
if err != nil {
return err
}
return appendIntToFile(filepath.Join(subsys.CPU, name, "tasks"), pid)
return appendIntToFile(filepath.Join(subsys.CPU, name, "cgroup.procs"), pid)
}

func appendIntToFile(filename string, data int) error {
Expand Down

0 comments on commit cba7473

Please sign in to comment.