mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
exec: don't panic on rootless raw_exec tasks (#26401)
the executor dies, leaving an orphaned process still running. the panic fix: * don't `panic()` * and return an empty, but non-nil, func on cgroup error feature fix: * allow non-root agent to proceed with exec when cgroups are off
This commit is contained in:
@@ -7,7 +7,6 @@ package executor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@@ -766,7 +765,7 @@ func (l *LibcontainerExecutor) configureCgroups(cfg *runc.Config, command *ExecC
|
||||
|
||||
cg := command.StatsCgroup()
|
||||
if cg == "" {
|
||||
return errors.New("cgroup must be set")
|
||||
return fmt.Errorf("configureCgroups: %w", ErrCgroupMustBeSet)
|
||||
}
|
||||
|
||||
// // set the libcontainer hook for writing the PID to cgroup.procs file
|
||||
|
||||
Reference in New Issue
Block a user