1SYSTEMD-COREDUMP(8) systemd-coredump SYSTEMD-COREDUMP(8)
2
3
4
6 systemd-coredump, systemd-coredump.socket, systemd-coredump@.service -
7 Acquire, save and process core dumps
8
10 /usr/lib/systemd/systemd-coredump
11
12 /usr/lib/systemd/systemd-coredump --backtrace
13
14 systemd-coredump@.service
15
16 systemd-coredump.socket
17
19 systemd-coredump@.service is a system service that can acquire core
20 dumps from the kernel and handle them in various ways. The
21 systemd-coredump executable does the actual work. It is invoked twice:
22 once as the handler by the kernel, and the second time in the
23 systemd-coredump@.service to actually write the data to the journal.
24
25 When the kernel invokes systemd-coredump to handle a core dump, it runs
26 in privileged mode, and will connect to the socket created by the
27 systemd-coredump.socket unit, which in turn will spawn an unprivileged
28 systemd-coredump@.service instance to process the core dump. Hence
29 systemd-coredump.socket and systemd-coredump@.service are helper units
30 which do the actual processing of core dumps and are subject to normal
31 service management.
32
33 Core dumps can be written to the journal or saved as a file. Once saved
34 they can be retrieved for further processing, for example in gdb(1).
35
36 By default, systemd-coredump will log the core dump including a
37 backtrace if possible to the journal and store the core dump itself in
38 an external file in /var/lib/systemd/coredump.
39
40 The behavior of a specific program upon reception of a signal is
41 governed by a few factors which are described in detail in core(5). In
42 particular, the core dump will only be processed when the related
43 resource limits are sufficient.
44
45 It is also possible to invoke systemd-coredump with --backtrace option.
46 In this case, systemd-coredump expects a journal entry in the journal
47 Journal Export Format[1] on standard input. The entry should contain a
48 MESSAGE= field and any additional metadata fields the caller deems
49 reasonable. systemd-coredump will append additional metadata fields in
50 the same way it does for core dumps received from the kernel. In this
51 mode, no core dump is stored in the journal.
52
54 For programs started by systemd process resource limits can be set by
55 directive LimitCore=, see systemd.exec(5).
56
57 In order to be used by the kernel to handle core dumps,
58 systemd-coredump must be configured in sysctl(8) parameter
59 kernel.core_pattern. The syntax of this parameter is explained in
60 core(5). systemd installs the file /usr/lib/sysctl.d/50-coredump.conf
61 which configures kernel.core_pattern accordingly. This file may be
62 masked or overridden to use a different setting following normal
63 sysctl.d(5) rules. If the sysctl configuration is modified, it must be
64 updated in the kernel before it takes effect, see sysctl(8) and
65 systemd-sysctl(8).
66
67 In order to by used in the --backtrace mode, an appropriate backtrace
68 handler must be installed on the sender side. For example, in case of
69 python(1), this means a sys.excepthook must installed, see
70 systemd-coredump-python[2].
71
72 The behavior of systemd-coredump itself is configured through the
73 configuration file /etc/systemd/coredump.conf and corresponding
74 snippets /etc/systemd/coredump.conf.d/*.conf, see coredump.conf(5). A
75 new instance of systemd-coredump is invoked upon receiving every core
76 dump. Therefore, changes in these files will take effect the next time
77 a core dump is received.
78
79 Resources used by core dump files are restricted in two ways.
80 Parameters like maximum size of acquired core dumps and files can be
81 set in files /etc/systemd/coredump.conf and snippets mentioned above.
82 In addition the storage time of core dump files is restricted by
83 systemd-tmpfiles, corresponding settings are by default in
84 /usr/lib/tmpfiles.d/systemd.conf.
85
86 Disabling coredump processing
87 To disable potentially resource-intensive processing by
88 systemd-coredump, set
89
90 Storage=none
91 ProcessSizeMax=0
92
93 in coredump.conf(5).
94
96 Data stored in the journal can be viewed with journalctl(1) as usual.
97 coredumpctl(1) can be used to retrieve saved core dumps independent of
98 their location, to display information and to process them e.g. by
99 passing to the GNU debugger (gdb).
100
102 coredump.conf(5), coredumpctl(1), systemd-journald.service(8), systemd-
103 tmpfiles(8), core(5), sysctl.d(5), systemd-sysctl.service(8).
104
106 1. Journal Export Format
107 https://www.freedesktop.org/wiki/Software/systemd/export
108
109 2. systemd-coredump-python
110 https://github.com/keszybz/systemd-coredump-python
111
112
113
114systemd 246 SYSTEMD-COREDUMP(8)