systemd: switch to unified cgroup hierarchy by default
See https://www.redhat.com/sysadmin/fedora-31-control-group-v2 for details on why this is desirable, and how it impacts containers. Users that need to keep using the old cgroup hierarchy can re-enable it by setting `systemd.unifiedCgroupHierarchy` to `false`. Well-known candidates not supporting that hierarchy, like docker and hidepid=… will disable it automatically. Fixes #73800
This commit is contained in:
@@ -550,6 +550,14 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.enableUnifiedCgroupHierarchy = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to enable the unified cgroup hierarchy (cgroupsv2).
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.coredump.enable = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
@@ -1178,6 +1186,7 @@ in
|
||||
boot.kernel.sysctl = mkIf (!cfg.coredump.enable) {
|
||||
"kernel.core_pattern" = "core";
|
||||
};
|
||||
boot.kernelParams = optional (!cfg.enableUnifiedCgroupHierarchy) "systemd.unified_cgroup_hierarchy=0";
|
||||
};
|
||||
|
||||
# FIXME: Remove these eventually.
|
||||
|
||||
Reference in New Issue
Block a user