{"id":3294,"date":"2022-12-20T17:02:16","date_gmt":"2022-12-20T20:02:16","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/systemdcoredump-man8\/"},"modified":"2022-12-20T17:02:16","modified_gmt":"2022-12-20T20:02:16","slug":"systemdcoredump-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/systemdcoredump-man8\/","title":{"rendered":"SYSTEMD&minus;COREDUMP (man8)"},"content":{"rendered":"<h1 align=\"center\">SYSTEMD\u2212COREDUMP<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#CONFIGURATION\">CONFIGURATION<\/a><br \/> <a href=\"#USAGE\">USAGE<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">systemd-coredump, systemd-coredump.socket, systemd-coredump@.service \u2212 Acquire, save and process core dumps<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">\/usr\/lib\/systemd\/systemd\u2212coredump<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/usr\/lib\/systemd\/systemd\u2212coredump <b>\u2212\u2212backtrace<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">systemd\u2212coredump@.service<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">systemd\u2212coredump.socket<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">systemd\u2212coredump@.service is a system service that can acquire core dumps from the kernel and handle them in various ways. The <b>systemd\u2212coredump<\/b> executable does the actual work. It is invoked twice: once as the handler by the kernel, and the second time in the systemd\u2212coredump@.service to actually write the data to the journal.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When the kernel invokes <b>systemd\u2212coredump<\/b> to handle a core dump, it runs in privileged mode, and will connect to the socket created by the systemd\u2212coredump.socket unit, which in turn will spawn an unprivileged systemd\u2212coredump@.service instance to process the core dump. Hence systemd\u2212coredump.socket and systemd\u2212coredump@.service are helper units which do the actual processing of core dumps and are subject to normal service management.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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 <b>gdb<\/b>(1).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">By default, <b>systemd\u2212coredump<\/b> will log the core dump including a backtrace if possible to the journal and store the core dump itself in an external file in \/var\/lib\/systemd\/coredump.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The behavior of a specific program upon reception of a signal is governed by a few factors which are described in detail in <b>core<\/b>(5). In particular, the core dump will only be processed when the related resource limits are sufficient.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">It is also possible to invoke <b>systemd\u2212coredump<\/b> with <b>\u2212\u2212backtrace<\/b> option. In this case, <b>systemd\u2212coredump<\/b> expects a journal entry in the journal <b><font color=\"#0000FF\">Journal Export Format<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">on standard input. The entry should contain a <i>MESSAGE=<\/i> field and any additional metadata fields the caller deems reasonable. <b>systemd\u2212coredump<\/b> will append additional metadata fields in the same way it does for core dumps received from the kernel. In this mode, no core dump is stored in the journal.<\/font><\/p>\n<h2>CONFIGURATION <a name=\"CONFIGURATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">For programs started by <b>systemd<\/b> process resource limits can be set by directive <i>LimitCore=<\/i>, see <b>systemd.exec<\/b>(5).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">In order to be used by the kernel to handle core dumps, <b>systemd\u2212coredump<\/b> must be configured in <b>sysctl<\/b>(8) parameter <i>kernel.core_pattern<\/i>. The syntax of this parameter is explained in <b>core<\/b>(5). systemd installs the file \/usr\/lib\/sysctl.d\/50\u2212coredump.conf which configures <i>kernel.core_pattern<\/i> accordingly. This file may be masked or overridden to use a different setting following normal <b>sysctl.d<\/b>(5) rules. If the sysctl configuration is modified, it must be updated in the kernel before it takes effect, see <b>sysctl<\/b>(8) and <b>systemd-sysctl<\/b>(8).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">In order to by used in the <b>\u2212\u2212backtrace<\/b> mode, an appropriate backtrace handler must be installed on the sender side. For example, in case of <b>python<\/b>(1), this means a <i>sys.excepthook<\/i> must installed, see<\/font> <b><font color=\"#0000FF\">systemd\u2212coredump\u2212python<\/font><\/b> <small><font color=\"#000000\">[2]<\/font><\/small> <font color=\"#000000\">.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">The behavior of <b>systemd\u2212coredump<\/b> itself is configured through the configuration file \/etc\/systemd\/coredump.conf and corresponding snippets \/etc\/systemd\/coredump.conf.d\/*.conf, see <b>coredump.conf<\/b>(5). A new instance of <b>systemd\u2212coredump<\/b> is invoked upon receiving every core dump. Therefore, changes in these files will take effect the next time a core dump is received.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">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 \/etc\/systemd\/coredump.conf and snippets mentioned above. In addition the storage time of core dump files is restricted by <b>systemd\u2212tmpfiles<\/b>, corresponding settings are by default in \/usr\/lib\/tmpfiles.d\/systemd.conf.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>Disabling coredump processing<\/b> <br \/> To disable potentially resource\u2212intensive processing by <b>systemd\u2212coredump<\/b>, set<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Storage=none <br \/> ProcessSizeMax=0<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">in <b>coredump.conf<\/b>(5).<\/font><\/p>\n<h2>USAGE <a name=\"USAGE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Data stored in the journal can be viewed with <b>journalctl<\/b>(1) as usual. <b>coredumpctl<\/b>(1) 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).<\/font><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>coredump.conf<\/b>(5), <b>coredumpctl<\/b>(1), <b>systemd-journald.service<\/b>(8), <b>systemd-tmpfiles<\/b>(8), <b>core<\/b>(5), <b>sysctl.d<\/b>(5), <b>systemd-sysctl.service<\/b>(8).<\/font><\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">1.<\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"32%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">Journal Export Format<\/font><\/p>\n<\/td>\n<td width=\"51%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">https:\/\/www.freedesktop.org\/wiki\/Software\/systemd\/export<\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">2.<\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"35%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">systemd-coredump-python<\/font><\/p>\n<\/td>\n<td width=\"48%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">https:\/\/github.com\/keszybz\/systemd-coredump-python<\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  systemd-coredump, systemd-coredump.socket, systemd-coredump@.service \u2212 Acquire, save and process core dumps <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,427],"class_list":["post-3294","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-systemd-coredump"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3294"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3294\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}