2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="coredump.conf" conditional="ENABLE_COREDUMP"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
9 <title>coredump.conf</title>
10 <productname>systemd</productname>
14 <refentrytitle>coredump.conf</refentrytitle>
15 <manvolnum>5</manvolnum>
19 <refname>coredump.conf</refname>
20 <refname>coredump.conf.d</refname>
21 <refpurpose>Core dump storage configuration files</refpurpose>
26 <member><filename>/etc/systemd/coredump.conf</filename></member>
27 <member><filename>/run/systemd/coredump.conf</filename></member>
28 <member><filename>/usr/local/lib/systemd/coredump.conf</filename></member>
29 <member><filename>/usr/lib/systemd/coredump.conf</filename></member>
30 <member><filename>/etc/systemd/coredump.conf.d/*.conf</filename></member>
31 <member><filename>/run/systemd/coredump.conf.d/*.conf</filename></member>
32 <member><filename>/usr/local/lib/systemd/coredump.conf.d/*.conf</filename></member>
33 <member><filename>/usr/lib/systemd/coredump.conf.d/*.conf</filename></member>
38 <title>Description</title>
40 <para>These files configure the behavior of
41 <citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
42 a handler for core dumps invoked by the kernel. Whether <command>systemd-coredump</command> is used
43 is determined by the kernel's
44 <varname>kernel.core_pattern</varname> <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
46 <citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>
48 <citerefentry project='man-pages'><refentrytitle>core</refentrytitle><manvolnum>5</manvolnum></citerefentry>
49 pages for the details.</para>
52 <xi:include href="standard-conf.xml" xpointer="main-conf" />
55 <title>Options</title>
57 <para>All options are configured in the
58 [Coredump] section:</para>
60 <variablelist class='config-directives'>
63 <term><varname>Storage=</varname></term>
65 <listitem><para>Controls where to store cores. One of <literal>none</literal>,
66 <literal>external</literal>, and <literal>journal</literal>. When <literal>none</literal>, the core
67 dumps may be logged (including the backtrace if possible), but not stored permanently. When
68 <literal>external</literal> (the default), cores will be stored in
69 <filename>/var/lib/systemd/coredump/</filename>. When <literal>journal</literal>, cores will be
70 stored in the journal and rotated following normal journal rotation patterns.</para>
72 <para>When cores are stored in the journal, they might be compressed following journal compression
74 <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
75 When cores are stored externally, they will be compressed by default, see below.</para>
77 <para>Note that in order to process a coredump (i.e. extract a stack trace) the core must be written
78 to disk first. Thus, unless <varname>ProcessSizeMax=</varname> is set to 0 (see below), the core will
79 be written to <filename>/var/lib/systemd/coredump/</filename> either way (under a temporary filename,
80 or even in an unlinked file), <varname>Storage=</varname> thus only controls whether to leave it
81 there even after it was processed.</para>
83 <xi:include href="version-info.xml" xpointer="v215"/></listitem>
87 <term><varname>Compress=</varname></term>
89 <listitem><para>Controls compression for external
90 storage. Takes a boolean argument, which defaults to
91 <literal>yes</literal>.</para>
93 <xi:include href="version-info.xml" xpointer="v215"/>
98 <term><varname>ProcessSizeMax=</varname></term>
100 <listitem><para>The maximum size in bytes of a core which will be processed. Core dumps exceeding
101 this size may be stored, but the stack trace will not be generated. Like other sizes in this same
102 config file, the usual suffixes to the base of 1024 are allowed (B, K, M, G, T, P, and E). Defaults
103 to 1G on 32-bit systems, 32G on 64-bit systems.</para>
105 <para>Setting <varname>Storage=none</varname> and <varname>ProcessSizeMax=0</varname>
106 disables all coredump handling except for a log entry.</para>
108 <xi:include href="version-info.xml" xpointer="v215"/>
113 <term><varname>EnterNamespace=</varname></term>
115 <listitem><para>Controls whether <command>systemd-coredump</command> will attempt to use the mount tree of
116 a process that crashed in PID namespace. Access to the namespace's mount tree might be necessary to generate
117 a fully symbolized backtrace. If set to <literal>yes</literal>, then <command>systemd-coredump</command> will
118 obtain the mount tree from corresponding mount namespace and will try to generate the stack trace using the
119 binary and libraries from the mount namespace. Note that the coredump of the namespaced process might
120 still be saved in <filename>/var/lib/systemd/coredump/</filename> even if <varname>EnterNamespace=</varname>
121 is set to <literal>no</literal>. Defaults to <literal>no</literal>.</para>
123 <xi:include href="version-info.xml" xpointer="v257"/>
128 <term><varname>ExternalSizeMax=</varname></term>
129 <term><varname>JournalSizeMax=</varname></term>
131 <listitem><para>The maximum (compressed or uncompressed) size in bytes of a coredump to be saved in
132 separate files on disk (default: 1G on 32-bit systems, 32G on 64-bit systems) or in the journal
133 (default: 767M). Note that the journal service enforces a hard limit on journal log records of 767M,
134 and will ignore larger submitted log records. Hence, <varname>JournalSizeMax=</varname> may be
135 lowered relative to the default, but not increased. Unit suffixes are allowed just as in
136 <option>ProcessSizeMax=</option>.</para>
138 <para><varname>ExternalSizeMax=infinity</varname> sets the core size to unlimited.</para>
140 <xi:include href="version-info.xml" xpointer="v215"/></listitem>
144 <term><varname>MaxUse=</varname></term>
145 <term><varname>KeepFree=</varname></term>
147 <listitem><para>Enforce limits on the disk space, specified
148 in bytes, taken up by externally stored core dumps.
149 Unit suffixes are allowed just as in <option>ProcessSizeMax=</option>.
150 <option>MaxUse=</option> makes
151 sure that old core dumps are removed as soon as the total disk
152 space taken up by core dumps grows beyond this limit (defaults
153 to 10% of the total disk size). <option>KeepFree=</option>
154 controls how much disk space to keep free at least (defaults
155 to 15% of the total disk size). Note that the disk space used
156 by core dumps might temporarily exceed these limits while
157 core dumps are processed. Note that old core dumps are also
158 removed based on time via
159 <citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
160 Set either value to 0 to turn off size-based cleanup.</para>
162 <xi:include href="version-info.xml" xpointer="v215"/></listitem>
166 <para>The defaults for all values are listed as comments in the
167 template <filename>/etc/systemd/coredump.conf</filename> file that
168 is installed by default.</para>
172 <title>See Also</title>
173 <para><simplelist type="inline">
174 <member><citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
175 <member><citerefentry><refentrytitle>coredumpctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
176 <member><citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>