2014-11-21 22:44:48 +03:00
<?xml version='1.0'?> <!-- * - Mode: nxml; nxml - child - indent: 2; indent - tabs - mode: nil - * -->
2014-07-14 04:32:46 +04:00
< !DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2015-06-18 20:47:44 +03:00
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
2014-07-14 04:32:46 +04:00
<!--
This file is part of systemd.
Copyright 2014 Zbigniew Jędrzejewski-Szmek
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http: / / w w w . g n u . o r g / l i c e n s e s /> .
-->
<refentry id= "systemd-coredump" conditional= 'ENABLE_COREDUMP'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo >
<title > systemd-coredump</title>
<productname > systemd</productname>
<authorgroup >
<author >
<contrib > Developer</contrib>
<firstname > Lennart</firstname>
<surname > Poettering</surname>
<email > lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta >
<refentrytitle > systemd-coredump</refentrytitle>
<manvolnum > 8</manvolnum>
</refmeta>
<refnamediv >
<refname > systemd-coredump</refname>
2016-04-06 04:00:10 +03:00
<refname > systemd-coredump.socket</refname>
<refname > systemd-coredump@.service</refname>
2016-05-16 12:56:04 +03:00
<refpurpose > Acquire, save and process core dumps</refpurpose>
2014-07-14 04:32:46 +04:00
</refnamediv>
<refsynopsisdiv >
2015-06-18 20:47:44 +03:00
<para > <filename > /usr/lib/systemd/systemd-coredump</filename> </para>
2016-04-06 04:00:10 +03:00
<para > <filename > systemd-coredump@.service</filename> </para>
<para > <filename > systemd-coredump.socket</filename> </para>
2014-07-14 04:32:46 +04:00
</refsynopsisdiv>
<refsect1 >
<title > Description</title>
2016-05-16 12:56:04 +03:00
<para > <command > systemd-coredump</command> is a system service that can acquire core dumps
from the kernel and handle them in various ways.</para>
2014-07-14 04:32:46 +04:00
2016-05-16 12:56:04 +03:00
<para > Core dumps can be written to the journal or saved as a file. Once saved they can be retrieved
for further processing, for example in
<citerefentry project= 'man-pages' > <refentrytitle > gdb</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> .
2014-07-14 04:32:46 +04:00
</para>
2016-05-16 12:56:04 +03:00
<para > By default, <command > systemd-coredump</command> will log the core dump including a backtrace
if possible to the journal and store the core dump itself in an external file in
<filename > /var/lib/systemd/coredump</filename> .</para>
2014-07-14 04:32:46 +04:00
2016-05-16 12:56:04 +03:00
<para > When the kernel invokes <command > systemd-coredump</command> to handle a core dump,
2016-04-06 04:00:10 +03:00
it will connect to the socket created by the <filename > systemd-coredump.socket</filename>
unit, which in turn will spawn a <filename > systemd-coredump@.service</filename> instance
2016-05-16 12:56:04 +03:00
to process the core dump. Hence <filename > systemd-coredump.socket</filename>
2016-04-06 04:00:10 +03:00
and <filename > systemd-coredump@.service</filename> are helper units which do the actual
2016-05-16 12:56:04 +03:00
processing of core dumps and are subject to normal service management.</para>
2016-04-06 04:00:10 +03:00
2016-05-16 12:56:04 +03:00
<para > The behavior of a specific program upon reception of a signal is governed by a few
factors which are described in detail in
<citerefentry project= 'man-pages' > <refentrytitle > core</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> .
In particular, the core dump will only be processed when the related resource limits are sufficient.
2016-04-02 17:40:09 +03:00
</para>
2016-05-16 12:56:04 +03:00
</refsect1>
2016-04-02 18:05:11 +03:00
2016-05-16 12:56:04 +03:00
<refsect1 >
<title > Configuration</title>
<para > For programs started by <command > systemd</command> process resource limits can be set by directive
<varname > LimitCore=</varname> , see
<citerefentry > <refentrytitle > systemd.exec</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> .
</para>
<para > In order to be used <command > systemd-coredump</command> must be configured in
<citerefentry project= 'man-pages' > <refentrytitle > sysctl</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry>
parameter <varname > kernel.core_pattern</varname> . The syntax of this parameter is explained in
<citerefentry project= 'man-pages' > <refentrytitle > core</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> .
Systemd installs the file <filename > /usr/lib/sysctl.d/50-coredump.conf</filename> which configures
<varname > kernel.core_pattern</varname> accordingly. This file may be masked or overridden to use a different
setting following normal
<citerefentry > <refentrytitle > sysctl.d</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry>
rules.
2016-04-02 18:05:11 +03:00
If the sysctl configuration is modified, it must be updated in the kernel before
it takes effect, see
2016-05-16 12:56:04 +03:00
<citerefentry project= 'man-pages' > <refentrytitle > sysctl</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry>
2016-04-02 18:05:11 +03:00
and
2016-05-16 12:56:04 +03:00
<citerefentry > <refentrytitle > systemd-sysctl</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> .
2016-04-02 18:05:11 +03:00
</para>
2016-05-16 12:56:04 +03:00
2016-10-13 00:02:44 +03:00
<para > The behavior of <command > systemd-coredump</command> itself is configured through the configuration file
2016-05-16 12:56:04 +03:00
<filename > /etc/systemd/coredump.conf</filename> and corresponding snippets
<filename > /etc/systemd/coredump.conf.d/*.conf</filename> , see
<citerefentry > <refentrytitle > coredump.conf</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> . A new
instance of <command > systemd-coredump</command> is invoked upon receiving every core dump. Therefore, changes
in these files will take effect the next time a core dump is received.</para>
<para > Resources used by core dump files are restricted in two ways. Parameters like maximum size of acquired
core dumps and files can be set in files <filename > /etc/systemd/coredump.conf</filename> and snippets mentioned
above. In addition the storage time of core dump files is restricted by <command > systemd-tmpfiles</command> ,
corresponding settings are by default in <filename > /usr/lib/tmpfiles.d/systemd.conf</filename> .</para>
</refsect1>
<refsect1 >
<title > Usage</title>
<para > Data stored in the journal can be viewed with
<citerefentry > <refentrytitle > journalctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry>
as usual.
<citerefentry > <refentrytitle > coredumpctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry>
can be used to retrieve saved core dumps independent of their location, to display information and to process
them e.g. by passing to the GNU debugger (gdb).</para>
2014-07-14 04:32:46 +04:00
</refsect1>
<refsect1 >
<title > See Also</title>
<para >
<citerefentry > <refentrytitle > coredump.conf</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > coredumpctl</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > systemd-journald.service</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ,
2016-05-16 12:56:04 +03:00
<citerefentry > <refentrytitle > systemd-tmpfiles</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ,
2014-07-14 04:32:46 +04:00
<citerefentry project= 'man-pages' > <refentrytitle > core</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > sysctl.d</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > systemd-sysctl.service</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> .
</para>
</refsect1>
</refentry>