summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-08-27 11:38:28 +0200
committerGitHub <noreply@github.com>2019-08-27 11:38:28 +0200
commit9a02d9c75e94aa63983a085df774ea9b7a728b29 (patch)
treebb6d696702528cdbae02c82887c73b61f0ec8ee3 /nixos
parent4b09f9995d47e8bb0cf04d3d8ba873e35d20c751 (diff)
parent6b075ddc8fc02358e5bd4b41cb3c36a691a1f424 (diff)
downloadnixpkgs-9a02d9c75e94aa63983a085df774ea9b7a728b29.tar
nixpkgs-9a02d9c75e94aa63983a085df774ea9b7a728b29.tar.gz
nixpkgs-9a02d9c75e94aa63983a085df774ea9b7a728b29.tar.bz2
nixpkgs-9a02d9c75e94aa63983a085df774ea9b7a728b29.tar.lz
nixpkgs-9a02d9c75e94aa63983a085df774ea9b7a728b29.tar.xz
nixpkgs-9a02d9c75e94aa63983a085df774ea9b7a728b29.tar.zst
nixpkgs-9a02d9c75e94aa63983a085df774ea9b7a728b29.zip
Merge pull request #66984 from flokli/systemd-cgroup-accounting
nixos/systemd: enable systemd cgroup accounting by default
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/release-notes/rl-1909.xml20
-rw-r--r--nixos/modules/system/boot/systemd.nix6
-rw-r--r--nixos/tests/systemd.nix7
3 files changed, 24 insertions, 9 deletions
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.
    </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>
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:"');
+   };
   '';
 })