Skip to content

Commit efe1ceb

Browse files
authored
Merge pull request #1901 from sohankunkerkar/fix-tasksaccounting-cgroupv2
libcrun/cgroup: always enable TasksAccounting for systemd
2 parents b889913 + 9feec59 commit efe1ceb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libcrun/cgroup-systemd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,9 +1761,11 @@ enter_systemd_cgroup_scope (runtime_spec_schema_config_linux_resources *resource
17611761
boolean_opts[i++] = "MemoryAccounting";
17621762
if (resources->block_io)
17631763
boolean_opts[i++] = "IOAccounting";
1764-
if (resources->pids)
1765-
boolean_opts[i++] = "TasksAccounting";
17661764
}
1765+
/* Always enable TasksAccounting to ensure the pids controller is available.
1766+
* This allows container managers to read pids.current even when no explicit
1767+
* pids limit is set. */
1768+
boolean_opts[i++] = "TasksAccounting";
17671769
boolean_opts[i++] = NULL;
17681770

17691771
ret = open_sd_bus_connection (&bus, err);

0 commit comments

Comments
 (0)