mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix(host): check subgroup enabled on cgroup init
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
This commit is contained in:
@@ -380,10 +380,14 @@ func (c *CGroupTask) init() bool {
|
||||
re := regexp.MustCompile(`\s+`)
|
||||
scanner := bufio.NewScanner(file)
|
||||
for scanner.Scan() {
|
||||
// #subsys_name hierarchy num_cgroups enabled
|
||||
line := scanner.Text()
|
||||
if line[0] != '#' {
|
||||
parts := re.Split(line, -1)
|
||||
module := parts[0]
|
||||
if parts[3] == "0" { // disabled
|
||||
continue
|
||||
}
|
||||
if !ModuleIsMounted(module) {
|
||||
moduleDir := path.Join(cgroupsPath, module)
|
||||
if !fileutils2.Exists(moduleDir) {
|
||||
|
||||
Reference in New Issue
Block a user