1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

Merge pull request #66984 from flokli/systemd-cgroup-accounting

nixos/systemd: enable systemd cgroup accounting by default
This commit is contained in:
Florian Klink 2019-08-27 11:38:28 +02:00 committed by GitHub
commit 9a02d9c75e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 9 deletions

View file

@ -506,12 +506,20 @@
been removed.
</para>
</listitem>
<listitem>
<para>
The <literal>rmilter</literal> package was removed with associated module and options due deprecation by upstream developer.
Use <literal>rspamd</literal> in proxy mode instead.
</para>
</listitem>
<listitem>
<para>
The <literal>rmilter</literal> package was removed with associated module and options due deprecation by upstream developer.
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>

View file

@ -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}

View file

@ -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:"');
};
'';
})