Setting the cg path after application of pid

This commit is contained in:
Diptanu Choudhury
2016-04-02 01:51:17 -07:00
parent 339cb0b750
commit 36d8c7e831
3 changed files with 9 additions and 3 deletions

View File

@@ -65,12 +65,15 @@ func (e *UniversalExecutor) applyLimits(pid int) error {
return err
}
e.cgPaths = manager.GetPaths()
cgConfig := cgroupConfig.Config{Cgroup: e.groups}
cgConfig := cgroupConfig.Config{Cgroups: e.groups}
if err := manager.Set(&cgConfig); err != nil {
e.logger.Printf("[ERR] executor: error setting cgroup config: %v", err)
if er := DestroyCgroup(e.groups, e.cgPaths); er != nil {
e.logger.Printf("[ERR] executor: error destroying cgroup: %v", er)
}
if er := e.removeChrootMounts(); er != nil {
e.logger.Printf("[ERR] executor: error removing chroot: %v", er)
}
return err
}
return nil