Entering the plugin pid into the cgroup after creating it
This commit is contained in:
parent
2871dfce26
commit
f4b32ae5fc
|
@ -94,9 +94,6 @@ func (e *UniversalExecutor) LaunchCmd(command *ExecCommand, ctx *ExecutorContext
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// entering the plugin process in cgroup
|
||||
e.applyLimits(os.Getpid())
|
||||
|
||||
// setting the user of the process
|
||||
if e.ctx.UnprivilegedUser {
|
||||
if err := e.runAs("nobody"); err != nil {
|
||||
|
|
|
@ -45,6 +45,15 @@ func (e *UniversalExecutor) configureIsolation() error {
|
|||
if err := e.configureCgroups(e.ctx.TaskResources); err != nil {
|
||||
return fmt.Errorf("error creating cgroups: %v", err)
|
||||
}
|
||||
if err := e.applyLimits(os.Getpid()); err != nil {
|
||||
if er := e.destroyCgroup(); er != nil {
|
||||
e.logger.Printf("[ERROR] error destroying cgroup: %v", er)
|
||||
}
|
||||
if er := e.removeChrootMounts(); er != nil {
|
||||
e.logger.Printf("[ERROR] error removing chroot: %v", er)
|
||||
}
|
||||
return fmt.Errorf("error entering the plugin process in the cgroup: %v:", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue