diff options
author | Xi Ruoyao <xry111@mengyan1223.wang> | 2020-03-14 07:10:05 +0000 |
---|---|---|
committer | Xi Ruoyao <xry111@mengyan1223.wang> | 2020-03-14 07:10:05 +0000 |
commit | 4d796cab3ef4508b3c3dbf5931a1eada35e29775 (patch) | |
tree | d9f559985adf657636f52f15fad94751c444d7ef /chapter07 | |
parent | 6fb10045a94ea6ffc1b47bbb44667f8e15a7c6f8 (diff) |
systemd-custom: add a section discussing core dumps
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11781 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07')
-rw-r--r-- | chapter07/systemd-custom.xml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/chapter07/systemd-custom.xml b/chapter07/systemd-custom.xml index 45d57ce65..787fd4572 100644 --- a/chapter07/systemd-custom.xml +++ b/chapter07/systemd-custom.xml @@ -210,6 +210,52 @@ EOF</userinput></screen> </sect2> <sect2> + <title>Working with Core Dumps</title> + + <para>Core dumps are useful to debug crashed programs, especially + when a daemon process crashes. On systemd booted systems the core + dumping is handled by <command>systemd-coredump</command>. It will + log the core dump into the journal and store the core dump itself in + <filename class="directory">/var/lib/systemd/coredump</filename>. + To retrieve and process core dumps, <command>coredumpctl</command> + tool is provided. Here are some examples of frequently used commands: + </para> + + <itemizedlist> + <listitem> + <para><command>coredumpctl -r</command>: lists all core dumps in + reversed chronological order.</para> + </listitem> + <listitem> + <para><command>coredumpctl -1 info</command>: show the information + of the last core dump.</para> + </listitem> + <listitem> + <para><command>coredumpctl -1 debug</command>: load the last core + dump into <ulink url="&blfs-book;general/gdb.html">GDB</ulink>. + </para> + </listitem> + </itemizedlist> + + <para>Core dumps may use a lot of disk space. The maximum disk space + used by core dumps can be limited by creating a configuration file in + <filename class="directory">/etc/systemd/coredump.conf.d</filename>. + For example:</para> + +<screen role="nodump"><userinput>mkdir -pv /etc/systemd/coredump.conf.d + +cat > /etc/systemd/coredump.conf.d/maxuse.conf << EOF +<literal>[Coredump] +MaxUse=5G</literal> +EOF</userinput></screen> + + <para>See <filename>systemd-coredump(8)</filename>, + <filename>coredumpctl(1)</filename>, and + <filename>coredump.conf.d(5)</filename> manual pages for more + information.</para> + </sect2> + + <sect2> <title>Long Running Processes</title> <para>Beginning with systemd-230, all user processes are killed when a user |