| 1 |
<?xml version='1.0'?> |
| 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 --> |
| 5 |
|
| 6 |
<refentry id="coredump.conf" conditional="ENABLE_COREDUMP" |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
<refentryinfo> |
| 9 |
<title>coredump.conf</title> |
| 10 |
<productname>systemd</productname> |
| 11 |
</refentryinfo> |
| 12 |
|
| 13 |
<refmeta> |
| 14 |
<refentrytitle>coredump.conf</refentrytitle> |
| 15 |
<manvolnum>5</manvolnum> |
| 16 |
</refmeta> |
| 17 |
|
| 18 |
<refnamediv> |
| 19 |
<refname>coredump.conf</refname> |
| 20 |
<refname>coredump.conf.d</refname> |
| 21 |
<refpurpose>Core dump storage configuration files</refpurpose> |
| 22 |
</refnamediv> |
| 23 |
|
| 24 |
<refsynopsisdiv> |
| 25 |
<para><simplelist> |
| 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> |
| 34 |
</simplelist></para> |
| 35 |
</refsynopsisdiv> |
| 36 |
|
| 37 |
<refsect1> |
| 38 |
<title>Description</title> |
| 39 |
|
| 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> |
| 45 |
setting. See |
| 46 |
<citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 47 |
and |
| 48 |
<citerefentry project='man-pages'><refentrytitle>core</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 49 |
pages for the details.</para> |
| 50 |
</refsect1> |
| 51 |
|
| 52 |
<xi:include href="standard-conf.xml" xpointer="main-conf" /> |
| 53 |
|
| 54 |
<refsect1> |
| 55 |
<title>Options</title> |
| 56 |
|
| 57 |
<para>All options are configured in the |
| 58 |
[Coredump] section:</para> |
| 59 |
|
| 60 |
<variablelist class='config-directives'> |
| 61 |
|
| 62 |
<varlistentry> |
| 63 |
<term><varname>Storage=</varname></term> |
| 64 |
|
| 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> |
| 71 |
|
| 72 |
<para>When cores are stored in the journal, they might be compressed following journal compression |
| 73 |
settings, see |
| 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> |
| 76 |
|
| 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> |
| 82 |
|
| 83 |
<xi:include href="version-info.xml" xpointer="v215"/></listitem> |
| 84 |
</varlistentry> |
| 85 |
|
| 86 |
<varlistentry> |
| 87 |
<term><varname>Compress=</varname></term> |
| 88 |
|
| 89 |
<listitem><para>Controls compression for external |
| 90 |
storage. Takes a boolean argument, which defaults to |
| 91 |
<literal>yes</literal>.</para> |
| 92 |
|
| 93 |
<xi:include href="version-info.xml" xpointer="v215"/> |
| 94 |
</listitem> |
| 95 |
</varlistentry> |
| 96 |
|
| 97 |
<varlistentry> |
| 98 |
<term><varname>ProcessSizeMax=</varname></term> |
| 99 |
|
| 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> |
| 104 |
|
| 105 |
<para>Setting <varname>Storage=none</varname> and <varname>ProcessSizeMax=0</varname> |
| 106 |
disables all coredump handling except for a log entry.</para> |
| 107 |
|
| 108 |
<xi:include href="version-info.xml" xpointer="v215"/> |
| 109 |
</listitem> |
| 110 |
</varlistentry> |
| 111 |
|
| 112 |
<varlistentry> |
| 113 |
<term><varname>EnterNamespace=</varname></term> |
| 114 |
|
| 115 |
<listitem><para>For processes belonging to a PID namespace, controls whether |
| 116 |
<citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 117 |
shall attempt to process core dumps on the host, using debug |
| 118 |
information from the file system hierarchy (i.e. the mount namespace) of the process that |
| 119 |
crashed. Access to the process' file system hierarchy might be necessary to generate a fully |
| 120 |
symbolized backtrace. If set to <literal>yes</literal>, <command>systemd-coredump</command> will |
| 121 |
obtain the tree of mounts from the crashing process' mount namespace and will try to generate the stack |
| 122 |
trace in host context using the debug information of binaries and libraries contained in the crashing |
| 123 |
process' hierarchy. Defaults to <literal>no</literal>, i.e. no attempt is made to acquire external |
| 124 |
debug information from the process' mount namespace, in order to maximize security. This option has |
| 125 |
no effect on processes that are part of the host's PID namespace.</para> |
| 126 |
|
| 127 |
<para>Note that the coredump of the namespaced process is still saved in |
| 128 |
<filename>/var/lib/systemd/coredump/</filename> on the host even if |
| 129 |
<varname>EnterNamespace=</varname> is set to <literal>no</literal> (subject to |
| 130 |
<varname>Storage=</varname>).</para> |
| 131 |
|
| 132 |
<para>Note that <varname>EnterNamespace=</varname> only has an effect if a core dump is generated by |
| 133 |
a container whose unit does not have <varname>CoredumpReceive=</varname> enabled.</para> |
| 134 |
|
| 135 |
<para>Note that it's typically preferable to let containers and other namespace-based sandboxes |
| 136 |
process their own coredumps, if possible, for best security. This may be enabled on the container's |
| 137 |
unit via the <varname>CoredumpReceive=</varname> setting, see |
| 138 |
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 139 |
for details.</para> |
| 140 |
|
| 141 |
<xi:include href="version-info.xml" xpointer="v257"/> |
| 142 |
</listitem> |
| 143 |
</varlistentry> |
| 144 |
|
| 145 |
<varlistentry> |
| 146 |
<term><varname>ExternalSizeMax=</varname></term> |
| 147 |
<term><varname>JournalSizeMax=</varname></term> |
| 148 |
|
| 149 |
<listitem><para>The maximum (compressed or uncompressed) size in bytes of a coredump to be saved in |
| 150 |
separate files on disk (default: 1G on 32-bit systems, 32G on 64-bit systems) or in the journal |
| 151 |
(default: 767M). Note that the journal service enforces a hard limit on journal log records of 767M, |
| 152 |
and will ignore larger submitted log records. Hence, <varname>JournalSizeMax=</varname> may be |
| 153 |
lowered relative to the default, but not increased. Unit suffixes are allowed just as in |
| 154 |
<option>ProcessSizeMax=</option>.</para> |
| 155 |
|
| 156 |
<para><varname>ExternalSizeMax=infinity</varname> sets the core size to unlimited.</para> |
| 157 |
|
| 158 |
<xi:include href="version-info.xml" xpointer="v215"/></listitem> |
| 159 |
</varlistentry> |
| 160 |
|
| 161 |
<varlistentry> |
| 162 |
<term><varname>MaxUse=</varname></term> |
| 163 |
<term><varname>KeepFree=</varname></term> |
| 164 |
|
| 165 |
<listitem><para>Enforce limits on the disk space, specified |
| 166 |
in bytes, taken up by externally stored core dumps. |
| 167 |
Unit suffixes are allowed just as in <option>ProcessSizeMax=</option>. |
| 168 |
<option>MaxUse=</option> makes |
| 169 |
sure that old core dumps are removed as soon as the total disk |
| 170 |
space taken up by core dumps grows beyond this limit (defaults |
| 171 |
to 10% of the total disk size, capped at 4GiB, minimum 1MiB). |
| 172 |
<option>KeepFree=</option> controls how much disk space to keep |
| 173 |
free at least (defaults to 15% of the total disk size, limited |
| 174 |
to a maximum of 4GiB). Note that the disk space used |
| 175 |
by core dumps might temporarily exceed these limits while |
| 176 |
core dumps are processed. <option>MaxUse=</option> takes precedence. |
| 177 |
Note that old core dumps are also |
| 178 |
removed based on time via |
| 179 |
<citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
| 180 |
Set either value to 0 to turn off size-based cleanup.</para> |
| 181 |
|
| 182 |
<xi:include href="version-info.xml" xpointer="v215"/></listitem> |
| 183 |
</varlistentry> |
| 184 |
</variablelist> |
| 185 |
|
| 186 |
<para>Use <programlisting>systemd-analyze cat-config systemd/coredump.conf</programlisting> |
| 187 |
to display the full config.</para> |
| 188 |
</refsect1> |
| 189 |
|
| 190 |
<refsect1> |
| 191 |
<title>See Also</title> |
| 192 |
<para><simplelist type="inline"> |
| 193 |
<member><citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 194 |
<member><citerefentry><refentrytitle>coredumpctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 195 |
<member><citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 196 |
</simplelist></para> |
| 197 |
</refsect1> |
| 198 |
|
| 199 |
</refentry> |