Skip to content

Commit

Permalink
Avoid setting the lxc custom cappings before the cgroups hierarchy cl…
Browse files Browse the repository at this point in the history
…eanup-reset
  • Loading branch information
cvaroqui committed Aug 30, 2021
1 parent 0a96b8e commit 14ed335
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion opensvc/drivers/resource/container/lxc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def set_cpuset_clone_children(self):
except (OSError, IOError):
# errno 17: file exists
pass
paths = [path]
paths = []
while path != ppath:
path = os.path.dirname(path)
paths.append(path)
Expand All @@ -460,6 +460,8 @@ def set_cpuset_clone_children(self):
continue
if current_val == "":
parent_val = self.get_sysfs(ppath, parm)
if parent_val is None:
raise ex.Error("failed to read %s/%s" % (ppath, parm))
self.set_sysfs(path, parm, parent_val)
parm = "cgroup.clone_children"
current_val = self.get_sysfs(path, parm)
Expand Down Expand Up @@ -496,9 +498,16 @@ def cleanup_cgroup(self, grp="*"):
except Exception as exc:
self.log.debug("failed to remove leftover cgroup %s: %s", path, str(exc))

def create_pg(self):
"""
Disable the normal create_pg(), so we can schedule it after set_cpuset_clone_children().
"""
pass

def container_start(self):
self.cleanup_cgroup()
self.set_cpuset_clone_children()
super(ContainerLxc, self).create_pg()
self.install_cf()
self.lxc('start')

Expand Down

0 comments on commit 14ed335

Please sign in to comment.