]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/coredumpctl.xml
man: change noindex="true" to index="false"
[thirdparty/systemd.git] / man / coredumpctl.xml
CommitLineData
5de0409e 1<?xml version='1.0'?> <!--*-nxml-*-->
3a54a157 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0307f791 4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
5de0409e 5
f4bab169 6<refentry id="coredumpctl" conditional='ENABLE_COREDUMP'
798d3a52
ZJS
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>coredumpctl</title>
11 <productname>systemd</productname>
798d3a52
ZJS
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>coredumpctl</refentrytitle>
16 <manvolnum>1</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>coredumpctl</refname>
246ba4aa 21 <refpurpose>Retrieve and process saved core dumps and metadata</refpurpose>
798d3a52
ZJS
22 </refnamediv>
23
24 <refsynopsisdiv>
25 <cmdsynopsis>
26 <command>coredumpctl</command>
27 <arg choice="opt" rep="repeat">OPTIONS</arg>
28 <arg choice="req">COMMAND</arg>
29 <arg choice="opt" rep="repeat">PID|COMM|EXE|MATCH</arg>
30 </cmdsynopsis>
31 </refsynopsisdiv>
32
33 <refsect1>
34 <title>Description</title>
35
246ba4aa
PM
36 <para><command>coredumpctl</command> is a tool that can be used to retrieve and process core
37 dumps and metadata which were saved by
38 <citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
39 </para>
798d3a52
ZJS
40 </refsect1>
41
246ba4aa
PM
42 <refsect1>
43 <title>Commands</title>
798d3a52
ZJS
44
45 <para>The following commands are understood:</para>
46
47 <variablelist>
48 <varlistentry>
49 <term><command>list</command></term>
50
246ba4aa 51 <listitem><para>List core dumps captured in the journal
798d3a52 52 matching specified characteristics. If no command is
246ba4aa
PM
53 specified, this is the implied default.</para>
54
cc4419ed
ZJS
55 <para>The output is designed to be human readable and contains list contains
56 a table with the following columns:</para>
57 <variablelist>
58 <varlistentry>
59 <term>TIME</term>
60 <listitem><para>The timestamp of the crash, as reported by the kernel.</para>
61 </listitem>
62 </varlistentry>
63
64 <varlistentry>
65 <term>PID</term>
66 <listitem><para>The identifier of the process that crashed.</para>
67 </listitem>
68 </varlistentry>
69
70 <varlistentry>
71 <term>UID</term>
72 <term>GID</term>
73 <listitem><para>The user and group identifiers of the process that crashed.</para>
74 </listitem>
75 </varlistentry>
76
77 <varlistentry>
78 <term>SIGNAL</term>
79 <listitem><para>The signal that caused the process to crash, when applicable.
80 </para></listitem>
81 </varlistentry>
82
83 <varlistentry>
84 <term>COREFILE</term>
85 <listitem><para>Information whether the coredump was stored, and whether
785889e5 86 it is still accessible: <literal>none</literal> means the core was
cc4419ed
ZJS
87 not stored, <literal>-</literal> means that it was not available (for
88 example because the process was not terminated by a signal),
89 <literal>present</literal> means that the core file is accessible by the
90 current user, <literal>journal</literal> means that the core was stored
91 in the <literal>journal</literal>, <literal>truncated</literal> is the
92 same as one of the previous two, but the core was too large and was not
93 stored in its entirety, <literal>error</literal> means that the core file
94 cannot be accessed, most likely because of insufficient permissions, and
95 <literal>missing</literal> means that the core was stored in a file, but
96 this file has since been removed.</para></listitem>
97 </varlistentry>
98
99 <varlistentry>
100 <term>EXE</term>
101 <listitem><para>The full path to the executable. For backtraces of scripts
102 this is the name of the interpreter.</para></listitem>
103 </varlistentry>
104 </variablelist>
105
246ba4aa
PM
106 <para>It's worth noting that different restrictions apply to
107 data saved in the journal and core dump files saved in
108 <filename>/var/lib/systemd/coredump</filename>, see overview in
109 <citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
110 Thus it may very well happen that a particular core dump is still listed
111 in the journal while its corresponding core dump file has already been
112 removed.</para></listitem>
798d3a52
ZJS
113 </varlistentry>
114
115 <varlistentry>
116 <term><command>info</command></term>
117
2fafabfd
LY
118 <listitem><para>Show detailed information about the last core dump
119 or core dumps matching specified characteristics
798d3a52
ZJS
120 captured in the journal.</para></listitem>
121 </varlistentry>
122
123 <varlistentry>
124 <term><command>dump</command></term>
125
246ba4aa
PM
126 <listitem><para>Extract the last core dump matching specified
127 characteristics. The core dump will be written on standard
798d3a52 128 output, unless an output file is specified with
f6a4dae6 129 <option>--output=</option>. </para></listitem>
798d3a52
ZJS
130 </varlistentry>
131
132 <varlistentry>
c5896b6a
RG
133 <term><command>debug</command></term>
134
135 <listitem><para>Invoke a debugger on the last core dump
136 matching specified characteristics. By default,
137 <citerefentry><refentrytitle>gdb</refentrytitle><manvolnum>1</manvolnum></citerefentry>
138 will be used. This may be changed using the <option>--debugger=</option>
139 option or the <varname>$SYSTEMD_DEBUGGER</varname> environment
140 variable.</para></listitem>
798d3a52
ZJS
141 </varlistentry>
142
143 </variablelist>
144
145 </refsect1>
146
e1fac8a6
ZJS
147 <refsect1>
148 <title>Options</title>
149
150 <para>The following options are understood:</para>
151
152 <variablelist>
153
154 <xi:include href="standard-options.xml" xpointer="help" />
155 <xi:include href="standard-options.xml" xpointer="version" />
156
157 <varlistentry>
158 <term><option>--no-legend</option></term>
159
160 <listitem><para>Do not print column headers.</para></listitem>
161 </varlistentry>
162
163 <xi:include href="standard-options.xml" xpointer="no-pager" />
164
165 <varlistentry>
166 <term><option>-1</option></term>
167
168 <listitem><para>Show information of a single core dump only, instead of listing
169 all known core dumps.</para></listitem>
170 </varlistentry>
171
172 <varlistentry>
173 <term><option>-S</option></term>
174 <term><option>--since</option></term>
175
176 <listitem><para>Only print entries which are since the specified date.</para></listitem>
177 </varlistentry>
178
179 <varlistentry>
180 <term><option>-U</option></term>
181 <term><option>--until</option></term>
182
183 <listitem><para>Only print entries which are until the specified date.</para></listitem>
184 </varlistentry>
185
186 <varlistentry>
187 <term><option>-r</option></term>
188 <term><option>--reverse</option></term>
189
190 <listitem><para>Reverse output so that the newest entries are displayed first.
191 </para></listitem>
192 </varlistentry>
193
194 <varlistentry>
195 <term><option>-F</option> <replaceable>FIELD</replaceable></term>
196 <term><option>--field=</option><replaceable>FIELD</replaceable></term>
197
198 <listitem><para>Print all possible data values the specified
199 field takes in matching core dump entries of the
200 journal.</para></listitem>
201 </varlistentry>
202
203 <varlistentry>
204 <term><option>-o</option> <replaceable>FILE</replaceable></term>
205 <term><option>--output=</option><replaceable>FILE</replaceable></term>
206
207 <listitem><para>Write the core to <option>FILE</option>.
208 </para></listitem>
209 </varlistentry>
210
211 <varlistentry>
212 <term><option>--debugger=</option><replaceable>DEBUGGER</replaceable></term>
213
214 <listitem><para>Use the given debugger for the <command>debug</command>
215 command. If not given and <varname>$SYSTEMD_DEBUGGER</varname> is unset, then
216 <citerefentry><refentrytitle>gdb</refentrytitle><manvolnum>1</manvolnum></citerefentry>
217 will be used. </para></listitem>
218 </varlistentry>
219
220 <varlistentry>
221 <term><option>-D</option> <replaceable>DIR</replaceable></term>
222 <term><option>--directory=</option><replaceable>DIR</replaceable></term>
223
224 <listitem><para>Use the journal files in the specified <option>DIR</option>.
225 </para></listitem>
226 </varlistentry>
227
228 <varlistentry>
229 <term><option>-q</option></term>
230 <term><option>--quiet</option></term>
231
232 <listitem><para>Suppresses informational messages about lack
233 of access to journal files and possible in-flight coredumps.
234 </para></listitem>
235 </varlistentry>
236 </variablelist>
237 </refsect1>
238
798d3a52
ZJS
239 <refsect1>
240 <title>Matching</title>
241
242 <para>A match can be:</para>
243
244 <variablelist>
245 <varlistentry>
246 <term><replaceable>PID</replaceable></term>
247
248 <listitem><para>Process ID of the
249 process that dumped
250 core. An integer.</para></listitem>
251 </varlistentry>
252
253 <varlistentry>
254 <term><replaceable>COMM</replaceable></term>
255
256 <listitem><para>Name of the executable (matches
257 <option>COREDUMP_COMM=</option>). Must not contain slashes.
258 </para></listitem>
259 </varlistentry>
260
261 <varlistentry>
262 <term><replaceable>EXE</replaceable></term>
263
264 <listitem><para>Path to the executable (matches
265 <option>COREDUMP_EXE=</option>). Must contain at least one
266 slash. </para></listitem>
267 </varlistentry>
268
269 <varlistentry>
270 <term><replaceable>MATCH</replaceable></term>
271
f8fde9ab
ZJS
272 <listitem><para>General journalctl match filter, must contain an equals
273 sign (<literal>=</literal>). See
274 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
275 </para></listitem>
798d3a52
ZJS
276 </varlistentry>
277 </variablelist>
278 </refsect1>
279
280 <refsect1>
281 <title>Exit status</title>
282 <para>On success, 0 is returned; otherwise, a non-zero failure
246ba4aa 283 code is returned. Not finding any matching core dumps is treated as
798d3a52
ZJS
284 failure.
285 </para>
286 </refsect1>
287
60e9682a
ZJS
288 <refsect1>
289 <title>Environment</title>
290
291 <variablelist class='environment-variables'>
292 <varlistentry>
293 <term><varname>$SYSTEMD_DEBUGGER</varname></term>
294 <listitem><para>Use the given debugger for the <command>debug</command>
295 command. See the <option>--debugger=</option> option.</para></listitem>
296 </varlistentry>
297 </variablelist>
298 </refsect1>
299
798d3a52
ZJS
300 <refsect1>
301 <title>Examples</title>
302
303 <example>
246ba4aa 304 <title>List all the core dumps of a program named foo</title>
798d3a52
ZJS
305
306 <programlisting># coredumpctl list foo</programlisting>
307 </example>
308
309 <example>
246ba4aa 310 <title>Invoke gdb on the last core dump</title>
798d3a52 311
c5896b6a 312 <programlisting># coredumpctl debug</programlisting>
798d3a52
ZJS
313 </example>
314
315 <example>
316 <title>Show information about a process that dumped core,
317 matching by its PID 6654</title>
318
319 <programlisting># coredumpctl info 6654</programlisting>
320 </example>
321
322 <example>
246ba4aa 323 <title>Extract the last core dump of /usr/bin/bar to a file named
b0343f8c 324 <filename index="false">bar.coredump</filename></title>
798d3a52
ZJS
325
326 <programlisting># coredumpctl -o bar.coredump dump /usr/bin/bar</programlisting>
327 </example>
328 </refsect1>
329
330 <refsect1>
331 <title>See Also</title>
332 <para>
333 <citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
334 <citerefentry><refentrytitle>coredump.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
335 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
336 <citerefentry project='man-pages'><refentrytitle>gdb</refentrytitle><manvolnum>1</manvolnum></citerefentry>
337 </para>
338 </refsect1>
5de0409e
ZJS
339
340</refentry>