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

Commit cba7473

Browse files
committed
Merge pull request #312 from bwester/cgroups
Use "cgroup.procs" for cgroup membership
2 parents 8055684 + e6c2a30 commit cba7473

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bin/p2-exec/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func cgEnter(platconf, launchableName, cgroupName string) error {
190190
} else if err != nil {
191191
return util.Errorf("Could not set cgroup parameters: %s", err)
192192
}
193-
return cg.AddPID(cgConfig.Name, os.Getpid())
193+
return cg.AddPID(cgConfig.Name, 0)
194194
}
195195

196196
// generalized code to remove rlimits on both darwin and linux

pkg/cgroups/cgroups.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ func (subsys Subsystems) Write(config Config) error {
173173
}
174174

175175
func (subsys Subsystems) AddPID(name string, pid int) error {
176-
err := appendIntToFile(filepath.Join(subsys.Memory, name, "tasks"), pid)
176+
err := appendIntToFile(filepath.Join(subsys.Memory, name, "cgroup.procs"), pid)
177177
if err != nil {
178178
return err
179179
}
180-
return appendIntToFile(filepath.Join(subsys.CPU, name, "tasks"), pid)
180+
return appendIntToFile(filepath.Join(subsys.CPU, name, "cgroup.procs"), pid)
181181
}
182182

183183
func appendIntToFile(filename string, data int) error {

0 commit comments

Comments
 (0)