]>
Commit | Line | Data |
---|---|---|
3802a3d3 | 1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
5146e7e8 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
5146e7e8 ZJS |
4 | |
5 | <!-- | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2014 Zbigniew Jędrzejewski-Szmek | |
9 | ||
10 | systemd is free software; you can redistribute it and/or modify it | |
11 | under the terms of the GNU Lesser General Public License as published by | |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
13 | (at your option) any later version. | |
14 | ||
15 | systemd is distributed in the hope that it will be useful, but | |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public License | |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
22 | --> | |
23 | ||
24 | <refentry id="systemd-coredump" conditional='ENABLE_COREDUMP' | |
25 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
26 | ||
27 | <refentryinfo> | |
28 | <title>systemd-coredump</title> | |
29 | <productname>systemd</productname> | |
30 | ||
31 | <authorgroup> | |
32 | <author> | |
33 | <contrib>Developer</contrib> | |
34 | <firstname>Lennart</firstname> | |
35 | <surname>Poettering</surname> | |
36 | <email>lennart@poettering.net</email> | |
37 | </author> | |
38 | </authorgroup> | |
39 | </refentryinfo> | |
40 | ||
41 | <refmeta> | |
42 | <refentrytitle>systemd-coredump</refentrytitle> | |
43 | <manvolnum>8</manvolnum> | |
44 | </refmeta> | |
45 | ||
46 | <refnamediv> | |
47 | <refname>systemd-coredump</refname> | |
6dfde7ac ZJS |
48 | <refname>systemd-coredump.socket</refname> |
49 | <refname>systemd-coredump@.service</refname> | |
246ba4aa | 50 | <refpurpose>Acquire, save and process core dumps</refpurpose> |
5146e7e8 ZJS |
51 | </refnamediv> |
52 | ||
53 | <refsynopsisdiv> | |
12b42c76 | 54 | <para><filename>/usr/lib/systemd/systemd-coredump</filename></para> |
6dfde7ac ZJS |
55 | <para><filename>systemd-coredump@.service</filename></para> |
56 | <para><filename>systemd-coredump.socket</filename></para> | |
5146e7e8 ZJS |
57 | </refsynopsisdiv> |
58 | ||
59 | <refsect1> | |
60 | <title>Description</title> | |
246ba4aa PM |
61 | <para><command>systemd-coredump</command> is a system service that can acquire core dumps |
62 | from the kernel and handle them in various ways.</para> | |
5146e7e8 | 63 | |
246ba4aa PM |
64 | <para>Core dumps can be written to the journal or saved as a file. Once saved they can be retrieved |
65 | for further processing, for example in | |
66 | <citerefentry project='man-pages'><refentrytitle>gdb</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
5146e7e8 ZJS |
67 | </para> |
68 | ||
246ba4aa PM |
69 | <para>By default, <command>systemd-coredump</command> will log the core dump including a backtrace |
70 | if possible to the journal and store the core dump itself in an external file in | |
71 | <filename>/var/lib/systemd/coredump</filename>.</para> | |
5146e7e8 | 72 | |
246ba4aa | 73 | <para>When the kernel invokes <command>systemd-coredump</command> to handle a core dump, |
6dfde7ac ZJS |
74 | it will connect to the socket created by the <filename>systemd-coredump.socket</filename> |
75 | unit, which in turn will spawn a <filename>systemd-coredump@.service</filename> instance | |
246ba4aa | 76 | to process the core dump. Hence <filename>systemd-coredump.socket</filename> |
6dfde7ac | 77 | and <filename>systemd-coredump@.service</filename> are helper units which do the actual |
246ba4aa | 78 | processing of core dumps and are subject to normal service management.</para> |
6dfde7ac | 79 | |
246ba4aa PM |
80 | <para>The behavior of a specific program upon reception of a signal is governed by a few |
81 | factors which are described in detail in | |
82 | <citerefentry project='man-pages'><refentrytitle>core</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
83 | In particular, the core dump will only be processed when the related resource limits are sufficient. | |
f3962329 | 84 | </para> |
246ba4aa | 85 | </refsect1> |
7382a3cc | 86 | |
246ba4aa PM |
87 | <refsect1> |
88 | <title>Configuration</title> | |
89 | <para>For programs started by <command>systemd</command> process resource limits can be set by directive | |
90 | <varname>LimitCore=</varname>, see | |
91 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
92 | </para> | |
93 | ||
94 | <para>In order to be used <command>systemd-coredump</command> must be configured in | |
95 | <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
96 | parameter <varname>kernel.core_pattern</varname>. The syntax of this parameter is explained in | |
97 | <citerefentry project='man-pages'><refentrytitle>core</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
98 | Systemd installs the file <filename>/usr/lib/sysctl.d/50-coredump.conf</filename> which configures | |
99 | <varname>kernel.core_pattern</varname> accordingly. This file may be masked or overridden to use a different | |
100 | setting following normal | |
101 | <citerefentry><refentrytitle>sysctl.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
102 | rules. | |
7382a3cc ZJS |
103 | If the sysctl configuration is modified, it must be updated in the kernel before |
104 | it takes effect, see | |
246ba4aa | 105 | <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
7382a3cc | 106 | and |
246ba4aa | 107 | <citerefentry><refentrytitle>systemd-sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
7382a3cc | 108 | </para> |
246ba4aa | 109 | |
2dd67817 | 110 | <para>The behavior of <command>systemd-coredump</command> itself is configured through the configuration file |
246ba4aa PM |
111 | <filename>/etc/systemd/coredump.conf</filename> and corresponding snippets |
112 | <filename>/etc/systemd/coredump.conf.d/*.conf</filename>, see | |
113 | <citerefentry><refentrytitle>coredump.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. A new | |
114 | instance of <command>systemd-coredump</command> is invoked upon receiving every core dump. Therefore, changes | |
115 | in these files will take effect the next time a core dump is received.</para> | |
116 | ||
117 | <para>Resources used by core dump files are restricted in two ways. Parameters like maximum size of acquired | |
118 | core dumps and files can be set in files <filename>/etc/systemd/coredump.conf</filename> and snippets mentioned | |
119 | above. In addition the storage time of core dump files is restricted by <command>systemd-tmpfiles</command>, | |
120 | corresponding settings are by default in <filename>/usr/lib/tmpfiles.d/systemd.conf</filename>.</para> | |
121 | </refsect1> | |
122 | ||
123 | <refsect1> | |
124 | <title>Usage</title> | |
125 | <para>Data stored in the journal can be viewed with | |
126 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
127 | as usual. | |
128 | <citerefentry><refentrytitle>coredumpctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
129 | can be used to retrieve saved core dumps independent of their location, to display information and to process | |
130 | them e.g. by passing to the GNU debugger (gdb).</para> | |
5146e7e8 ZJS |
131 | </refsect1> |
132 | ||
133 | <refsect1> | |
134 | <title>See Also</title> | |
135 | <para> | |
136 | <citerefentry><refentrytitle>coredump.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
137 | <citerefentry><refentrytitle>coredumpctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
138 | <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
246ba4aa | 139 | <citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
5146e7e8 ZJS |
140 | <citerefentry project='man-pages'><refentrytitle>core</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
141 | <citerefentry><refentrytitle>sysctl.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
142 | <citerefentry><refentrytitle>systemd-sysctl.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. | |
143 | </para> | |
144 | </refsect1> | |
145 | </refentry> |