]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: advertise shared drop-ins more
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 Feb 2021 13:54:54 +0000 (14:54 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 Feb 2021 20:14:04 +0000 (21:14 +0100)
systemd.unit(5) is a wall of text. And this particular feature can be very useful
in the context of resource control. Let's avertise this cool feature a bit more.

Fixes #17900.

man/systemd.resource-control.xml
man/systemd.unit.xml

index 33b6fcee8787d0b1329f4b995970640a791863f0..7062cd36379cd80d40462ff4cbb611109e3618e6 100644 (file)
     url="https://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/">New
     Control Group Interfaces</ulink> for an introduction on how to make
     use of resource control APIs from programs.</para>
+
+    <refsect2>
+      <title>Setting resource controls for a group of related units</title>
+
+      <para>As described in
+      <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, the
+      settings listed here may be set through the main file of a unit and drop-in snippets in
+      <filename index="false">*.d/</filename> directories. The list of directories searched for drop-ins
+      includes names formed by repeatedly truncating the unit name after all dashes. This is particularly
+      convenient to set resource limits for a group of units with similar names.</para>
+
+      <para>For example, every user gets their own slice
+      <filename>user-<replaceable>nnn</replaceable>.slice</filename>. Drop-ins with local configuration that
+      affect user 1000 may be placed in
+      <filename index="false">/etc/systemd/system/user-1000.slice</filename>,
+      <filename index="false">/etc/systemd/system/user-1000.slice.d/*.conf</filename>, but also
+      <filename index="false">/etc/systemd/system/user-.slice.d/*.conf</filename>. This last directory
+      applies to all user slices.</para>
+    </refsect2>
   </refsect1>
 
   <refsect1>
index 4d7d09c5c0dd9ebcd47fd9851a158be6fd479bb8..0453c783b6d593b4ccc4215c3d39e154f05a6322 100644 (file)
     headers. For instantiated units, this logic will first look for the instance <literal>.d/</literal> subdirectory
     (e.g. <literal>foo@bar.service.d/</literal>) and read its <literal>.conf</literal> files, followed by the template
     <literal>.d/</literal> subdirectory (e.g. <literal>foo@.service.d/</literal>) and the <literal>.conf</literal>
-    files there. Moreover for units names containing dashes (<literal>-</literal>), the set of directories generated by
-    truncating the unit name after all dashes is searched too. Specifically, for a unit name
+    files there. Moreover for unit names containing dashes (<literal>-</literal>), the set of directories generated by
+    repeatedly truncating the unit name after all dashes is searched too. Specifically, for a unit name
     <filename>foo-bar-baz.service</filename> not only the regular drop-in directory
     <filename>foo-bar-baz.service.d/</filename> is searched but also both <filename>foo-bar-.service.d/</filename> and
     <filename>foo-.service.d/</filename>. This is useful for defining common drop-ins for a set of related units, whose