mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
cgroup: when we unload a unit, also update all its parent's members mask
This way we can corectly ensure that when a unit that requires some controller goes away, we propagate the removal of it all the way up, so that the controller is turned off in all the parents too.
This commit is contained in:
parent
5af8805872
commit
b8b6f32104
@ -570,6 +570,14 @@ void unit_free(Unit *u) {
|
||||
if (!u)
|
||||
return;
|
||||
|
||||
if (UNIT_ISSET(u->slice)) {
|
||||
/* A unit is being dropped from the tree, make sure our parent slice recalculates the member mask */
|
||||
unit_invalidate_cgroup_members_masks(UNIT_DEREF(u->slice));
|
||||
|
||||
/* And make sure the parent is realized again, updating cgroup memberships */
|
||||
unit_add_to_cgroup_realize_queue(UNIT_DEREF(u->slice));
|
||||
}
|
||||
|
||||
u->transient_file = safe_fclose(u->transient_file);
|
||||
|
||||
if (!MANAGER_IS_RELOADING(u->manager))
|
||||
|
Loading…
x
Reference in New Issue
Block a user