Merge pull request #66984 from flokli/systemd-cgroup-accounting
nixos/systemd: enable systemd cgroup accounting by default
This commit is contained in:
commit
9a02d9c75e
@ -512,6 +512,14 @@
|
||||
Use <literal>rspamd</literal> in proxy mode instead.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
systemd cgroup accounting via the
|
||||
<link linkend="opt-systemd.enableCgroupAccounting">systemd.enableCgroupAccounting</link>
|
||||
option is now enabled by default. It now also enables the more recent Block IO and IP accounting
|
||||
features.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -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}
|
||||
|
@ -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:"');
|
||||
};
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user