mirror of
https://github.com/systemd/systemd.git
synced 2025-03-06 00:58:29 +03:00
manager: Freeze/Thaw: Don't fail units w/o cgroup
Previously, it was impossible to freeze or thaw a slice if it is an ancestor to a unit that had no running cgroup (i.e. a service with RemainAfterExit=yes). Instead of failing with EBUSY (which would confusingly get reported as "Unit has pending job") we just silently no-op. I noticed this because we now have user-runtime-dir@.service, which would make it impossible to freeze/thaw user.slice or user-<UID>.slice
This commit is contained in:
parent
a7f2019055
commit
e50bfc89ce
@ -5128,7 +5128,7 @@ int unit_cgroup_freezer_action(Unit *u, FreezerAction action) {
|
||||
|
||||
CGroupRuntime *crt = unit_get_cgroup_runtime(u);
|
||||
if (!crt || !crt->cgroup_realized)
|
||||
return -EBUSY;
|
||||
return 0; /* No cgroup = nothing running to freeze */
|
||||
|
||||
unit_next_freezer_state(u, action, &next, &target);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user