man: document default rlimits
authorAnita Zhang <the.anitazha@gmail.com>
Wed, 19 May 2021 07:33:59 +0000 (00:33 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 9 Jul 2021 15:03:54 +0000 (17:03 +0200)
Fixes #19645

(cherry picked from commit 1539124b394cec0c8d9d67a9ad6dbd00d085bdde)

man/custom-entities.ent.in
man/systemd-system.conf.xml

index 9963322fc9a88945000aec6eeb5609633a4d147c..a8b6aa57634ac22a99caf84804cc8aa62465dd0f 100644 (file)
@@ -11,5 +11,6 @@
 <!ENTITY KILL_USER_PROCESSES @KILL_USER_PROCESSES_YES_NO@>
 <!ENTITY DEBUGTTY @DEBUGTTY@>
 <!ENTITY RC_LOCAL_PATH @RC_LOCAL_PATH@>
+<!ENTITY HIGH_RLIMIT_NOFILE "@HIGH_RLIMIT_NOFILE@">
 <!ENTITY fedora_latest_version "33">
 <!ENTITY fedora_cloud_release "1.2">
index 1ac0077d86853fce216bcd0706eef7e9f0e4d167..3f229908c92fc87841e011dc41103c99cce63fcf 100644 (file)
         <varname>LimitXXX=</varname> directives and they accept the same parameter syntax,
         see <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
         for details. Note that these resource limits are only defaults
-        for units, they are not applied to the service manager process (i.e. PID 1) itself.</para></listitem>
+        for units, they are not applied to the service manager process (i.e. PID 1) itself.</para>
+
+        <para>Most of these settings are unset, which means the resource limits are inherited from the kernel or, if
+        invoked in a container, from the container manager. However, the following have defaults:</para>
+        <itemizedlist>
+          <listitem><para><varname>DefaultLimitNOFILE=</varname> defaults to <literal>1024:&HIGH_RLIMIT_NOFILE;</literal>.
+          </para></listitem>
+
+          <listitem><para><varname>DefaultLimitCORE=</varname> does not have a default but it is worth mentioning that
+          <varname>RLIMIT_CORE</varname> is set to <literal>infinity</literal> by PID 1 which is inherited by its
+          children.</para></listitem>
+
+          <listitem><para>Note that the service manager internally increases <varname>RLIMIT_MEMLOCK</varname> for
+          itself, however the limit is reverted to the original value for child processes forked off.</para></listitem>
+        </itemizedlist>
+
+      </listitem>
       </varlistentry>
 
       <varlistentry>