diff --git a/nixos/doc/manual/release-notes/rl-1909.xml b/nixos/doc/manual/release-notes/rl-1909.xml
index b02d99438de..85ad34f6a66 100644
--- a/nixos/doc/manual/release-notes/rl-1909.xml
+++ b/nixos/doc/manual/release-notes/rl-1909.xml
@@ -506,12 +506,20 @@
been removed.
-
-
- The rmilter package was removed with associated module and options due deprecation by upstream developer.
- Use rspamd in proxy mode instead.
-
-
+
+
+ The rmilter package was removed with associated module and options due deprecation by upstream developer.
+ Use rspamd in proxy mode instead.
+
+
+
+
+ systemd cgroup accounting via the
+ systemd.enableCgroupAccounting
+ option is now enabled by default. It now also enables the more recent Block IO and IP accounting
+ features.
+
+
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 23a2dd45d49..2a0360b12cb 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -537,7 +537,7 @@ in
};
systemd.enableCgroupAccounting = mkOption {
- default = false;
+ default = true;
type = types.bool;
description = ''
Whether to enable cgroup accounting.
@@ -804,10 +804,10 @@ in
[Manager]
${optionalString config.systemd.enableCgroupAccounting ''
DefaultCPUAccounting=yes
+ DefaultBlockIOAccounting=yes
DefaultIOAccounting=yes
DefaultBlockIOAccounting=yes
- DefaultMemoryAccounting=yes
- DefaultTasksAccounting=yes
+ DefaultIPAccounting=yes
''}
DefaultLimitCORE=infinity
${config.systemd.extraConfig}
diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix
index 3168c026d51..1c201e3b5dc 100644
--- a/nixos/tests/systemd.nix
+++ b/nixos/tests/systemd.nix
@@ -89,5 +89,12 @@ import ./make-test.nix ({ pkgs, ... }: {
$machine->waitForUnit('multi-user.target');
$machine->succeed('sysctl net.core.default_qdisc | grep -q "fq_codel"');
};
+
+ # Test cgroup accounting is enabled
+ subtest "systemd cgroup accounting is enabled", sub {
+ $machine->waitForUnit('multi-user.target');
+ $machine->succeed('systemctl show testservice1.service -p IOAccounting | grep -q "yes"');
+ $machine->succeed('systemctl status testservice1.service | grep -q "CPU:"');
+ };
'';
})