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