From f396232996b5d347cd743ff1d181ed6e5b7209f7 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 2 Apr 2016 10:40:09 -0400 Subject: man: add more cross-references to coredump.conf(5) and systemd-coredump(8) Fixes #2901. --- man/systemd-coredump.xml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'man/systemd-coredump.xml') diff --git a/man/systemd-coredump.xml b/man/systemd-coredump.xml index f1598461ef..0d3115094c 100644 --- a/man/systemd-coredump.xml +++ b/man/systemd-coredump.xml @@ -60,12 +60,13 @@ signal and dumps core. For it to be used in this capacity, it must be specified by the kernel.core_pattern sysctl8 - setting. Systemd installs - /usr/lib/sysctl.d/50-coredump.conf which - configures kernel.core_pattern to invoke - systemd-coredump. This file may be masked or - overridden to use a different setting following normal - sysctl.d5 rules. + setting. The syntax of this setting is explained in + core5. + Systemd installs /usr/lib/sysctl.d/50-coredump.conf which configures + kernel.core_pattern to invoke systemd-coredump. + This file may be masked or overridden to use a different setting following normal + sysctl.d5 + rules. The behavior of a specific program upon reception of a signal is governed by a few factors which are described in detail @@ -77,18 +78,19 @@ systemd.exec5). - systemd-coredump will log the coredump - including a backtrace if possible, and store the core (contents of - process' memory contents) in an external file on disk in - /var/lib/systemd/coredump, or directly in - the journal. This behavior may be modified using - coredump.conf5. + The behaviour of systemd-coredump is configured through + /etc/systemd/coredump.conf and other configuration files. See + coredump.conf5 + for details. By default, systemd-coredump will log the coredump including a + backtrace if possible, and store the core (contents of process' memory contents) in an external + file on disk in /var/lib/systemd/coredump. - Apart from the - journalctl1 - log viewer, + The log entry and a backtrace are stored in the journal, and can be viewed with + journalctl1. coredumpctl1 - may be used to list and extract coredumps. + may be used to list and extract coredumps or load them in + gdb1. + -- cgit v1.2.3-54-g00ecf From 7382a3cc232a0b60f1cd4604ce8fa9ae79f654e9 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 2 Apr 2016 11:05:11 -0400 Subject: man: describe how to reload sysctl configuration Also fixes option name (s/--path/--prefix/). --- man/systemd-coredump.xml | 9 ++++++ man/systemd-sysctl.service.xml | 69 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 68 insertions(+), 10 deletions(-) (limited to 'man/systemd-coredump.xml') diff --git a/man/systemd-coredump.xml b/man/systemd-coredump.xml index 0d3115094c..aa352448b2 100644 --- a/man/systemd-coredump.xml +++ b/man/systemd-coredump.xml @@ -91,6 +91,15 @@ may be used to list and extract coredumps or load them in gdb1. + + The coredump helper is invoked anew each time. Therefore, any configuration + changes will take effect on the invocation of systemd-coredump. + If the sysctl configuration is modified, it must be updated in the kernel before + it takes effect, see + systemd-sysctl8 + and + sysctl8. + diff --git a/man/systemd-sysctl.service.xml b/man/systemd-sysctl.service.xml index 9027ff0f3f..686b2cdef4 100644 --- a/man/systemd-sysctl.service.xml +++ b/man/systemd-sysctl.service.xml @@ -62,24 +62,29 @@ systemd-sysctl.service is an early boot service that configures sysctl8 - kernel parameters. + kernel parameters by invoking /usr/lib/systemd/systemd-sysctl. - If invoked with no arguments, it applies all directives from - all configuration files in - sysctl.d5 - are searched for a matching file. If one or more filenames are passed on - the command line, only the directives in these files are applied. - + When invoked with no arguments, /usr/lib/systemd/systemd-sysctl applies + all directives from configuration files listed in + sysctl.d5. + If one or more filenames are passed on the command line, only the directives in these files are + applied. + + In addition, option may be used to limit which sysctl + settings are applied. See sysctl.d5 - for information about the configuration of this service. + for information about the configuration of sysctl settings. After sysctl configuration is + changed on disk, it must be written to the files in /proc/sys before it + takes effect. It is possible to update specific settings, or simply to reload all configuration, + see Examples below. Options - - + + Only apply rules with the specified prefix. @@ -91,6 +96,50 @@ + + Examples + + + Reset all sysctl settings + + systemctl restart systemd-sysctl + + + + View coredump handler configuration + + # sysctl kernel.core_pattern +kernel.core_pattern = |/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t %P %I + + + + + Update coredump handler configuration + + # /usr/lib/systemd/systemd-sysctl --prefix kernel.core_pattern + + This searches all the directories listed in + sysctl.d5 + for configuration files and writes /proc/sys/kernel/core_pattern. + + + + Update coredump handler configuration according to a specific file + + # /usr/lib/systemd/systemd-sysctl 50-coredump.conf + + This applies all the settings found in 50-coredump.conf. + Either /etc/sysctl.d/50-coredump.conf, or + /run/sysctl.d/50-coredump.conf, or + /usr/lib/sysctl.d/50-coredump.conf will be used, in the order + of preference. + + + See + sysctl8 + for various ways to directly apply sysctl settings. + + See Also -- cgit v1.2.3-54-g00ecf From 6dfde7acf1405adbb7adb2adc6969c4eb3c0990a Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 5 Apr 2016 21:00:10 -0400 Subject: man: also mention systemd-coredump@.service and systemd-coredump.socket Added in 3c171f0b1e. --- Makefile-man.am | 12 +++++++++++- man/systemd-coredump.xml | 11 +++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'man/systemd-coredump.xml') diff --git a/Makefile-man.am b/Makefile-man.am index a7e348b1f1..db9b090432 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -1849,11 +1849,21 @@ MANPAGES += \ man/coredumpctl.1 \ man/systemd-coredump.8 MANPAGES_ALIAS += \ - man/coredump.conf.d.5 + man/coredump.conf.d.5 \ + man/systemd-coredump.socket.8 \ + man/systemd-coredump@.service.8 man/coredump.conf.d.5: man/coredump.conf.5 +man/systemd-coredump.socket.8: man/systemd-coredump.8 +man/systemd-coredump@.service.8: man/systemd-coredump.8 man/coredump.conf.d.html: man/coredump.conf.html $(html-alias) +man/systemd-coredump.socket.html: man/systemd-coredump.html + $(html-alias) + +man/systemd-coredump@.service.html: man/systemd-coredump.html + $(html-alias) + endif if ENABLE_EFI diff --git a/man/systemd-coredump.xml b/man/systemd-coredump.xml index aa352448b2..51dc27e8d3 100644 --- a/man/systemd-coredump.xml +++ b/man/systemd-coredump.xml @@ -45,11 +45,15 @@ systemd-coredump + systemd-coredump.socket + systemd-coredump@.service Log and store core dumps /usr/lib/systemd/systemd-coredump + systemd-coredump@.service + systemd-coredump.socket @@ -85,6 +89,13 @@ backtrace if possible, and store the core (contents of process' memory contents) in an external file on disk in /var/lib/systemd/coredump. + When the kernel invokes systemd-coredump to handle a coredump, + it will connect to the socket created by the systemd-coredump.socket + unit, which in turn will spawn a systemd-coredump@.service instance + to process the coredump. Hence systemd-coredump.socket + and systemd-coredump@.service are helper units which do the actual + processing of coredumps and are subject to normal service management. + The log entry and a backtrace are stored in the journal, and can be viewed with journalctl1. coredumpctl1 -- cgit v1.2.3-54-g00ecf From 246ba4aaa9bfa8bafcdba229d7324ca02d660155 Mon Sep 17 00:00:00 2001 From: Peter Mattern Date: Mon, 16 May 2016 11:56:04 +0200 Subject: coredump: Improve man pages --- man/coredump.conf.xml | 16 ++++---- man/coredumpctl.xml | 60 +++++++++++++++++------------ man/systemd-coredump.xml | 98 ++++++++++++++++++++++++++++-------------------- 3 files changed, 103 insertions(+), 71 deletions(-) (limited to 'man/systemd-coredump.xml') diff --git a/man/coredump.conf.xml b/man/coredump.conf.xml index 2064a96523..4f95680a3a 100644 --- a/man/coredump.conf.xml +++ b/man/coredump.conf.xml @@ -45,7 +45,7 @@ coredump.conf coredump.conf.d - Coredump storage configuration files + Core dump storage configuration files @@ -86,7 +86,7 @@ Controls where to store cores. One of none, external, journal, and both. When - none, the coredumps will be logged but not + none, the core dumps will be logged but not stored permanently. When external (the default), cores will be stored in /var/lib/systemd/coredump. When journal, cores will be stored in @@ -114,7 +114,7 @@ ProcessSizeMax= The maximum size in bytes of a core - which will be processed. Coredumps exceeding this size + which will be processed. Core dumps exceeding this size will be logged, but the backtrace will not be generated and the core will not be stored. @@ -132,14 +132,14 @@ KeepFree= Enforce limits on the disk space taken up by - externally stored coredumps. makes - sure that old coredumps are removed as soon as the total disk - space taken up by coredumps grows beyond this limit (defaults + externally stored core dumps. makes + sure that old core dumps are removed as soon as the total disk + space taken up by core dumps grows beyond this limit (defaults to 10% of the total disk size). controls how much disk space to keep free at least (defaults to 15% of the total disk size). Note that the disk space used - by coredumps might temporarily exceed these limits while - coredumps are processed. Note that old coredumps are also + by core dumps might temporarily exceed these limits while + core dumps are processed. Note that old core dumps are also removed based on time via systemd-tmpfiles8. Set either value to 0 to turn off size-based diff --git a/man/coredumpctl.xml b/man/coredumpctl.xml index 0f1afe77c3..abc245be5e 100644 --- a/man/coredumpctl.xml +++ b/man/coredumpctl.xml @@ -45,7 +45,7 @@ coredumpctl - Retrieve coredumps from the journal + Retrieve and process saved core dumps and metadata @@ -60,9 +60,10 @@ Description - coredumpctl may be used to - retrieve coredumps from - systemd-journald8. + coredumpctl is a tool that can be used to retrieve and process core + dumps and metadata which were saved by + systemd-coredump8. + @@ -71,18 +72,23 @@ The following options are understood: + + + + - Do not print column headers. - + Do not print column headers. + + - Show information of a single coredump only, - instead of listing all known coredumps. + Show information of a single core dump only, instead of listing + all known core dumps. @@ -90,7 +96,7 @@ FIELD Print all possible data values the specified - field takes in matching coredump entries of the + field takes in matching core dump entries of the journal. @@ -110,11 +116,11 @@ - - - - + + + + Commands The following commands are understood: @@ -122,23 +128,31 @@ list - List coredumps captured in the journal + List core dumps captured in the journal matching specified characteristics. If no command is - specified, this is the implied default. + specified, this is the implied default. + + It's worth noting that different restrictions apply to + data saved in the journal and core dump files saved in + /var/lib/systemd/coredump, see overview in + systemd-coredump8. + Thus it may very well happen that a particular core dump is still listed + in the journal while its corresponding core dump file has already been + removed. info - Show detailed information about coredumps + Show detailed information about core dumps captured in the journal. dump - Extract the last coredump matching specified - characteristics. The coredump will be written on standard + Extract the last core dump matching specified + characteristics. The core dump will be written on standard output, unless an output file is specified with . @@ -146,7 +160,7 @@ gdb - Invoke the GNU debugger on the last coredump + Invoke the GNU debugger on the last core dump matching specified characteristics. @@ -197,7 +211,7 @@ Exit status On success, 0 is returned; otherwise, a non-zero failure - code is returned. Not finding any matching coredumps is treated as + code is returned. Not finding any matching core dumps is treated as failure. @@ -206,13 +220,13 @@ Examples - List all the coredumps of a program named foo + List all the core dumps of a program named foo # coredumpctl list foo - Invoke gdb on the last coredump + Invoke gdb on the last core dump # coredumpctl gdb @@ -225,7 +239,7 @@ - Extract the last coredump of /usr/bin/bar to a file named + <title>Extract the last core dump of /usr/bin/bar to a file named <filename noindex="true">bar.coredump</filename> # coredumpctl -o bar.coredump dump /usr/bin/bar diff --git a/man/systemd-coredump.xml b/man/systemd-coredump.xml index 51dc27e8d3..a28dc62e5a 100644 --- a/man/systemd-coredump.xml +++ b/man/systemd-coredump.xml @@ -47,7 +47,7 @@ systemd-coredump systemd-coredump.socket systemd-coredump@.service - Log and store core dumps + Acquire, save and process core dumps @@ -58,59 +58,76 @@ Description + systemd-coredump is a system service that can acquire core dumps + from the kernel and handle them in various ways. - systemd-coredump can be used as a helper - binary by the kernel when a user space program receives a fatal - signal and dumps core. For it to be used in this capacity, it must - be specified by the - kernel.core_pattern sysctl8 - setting. The syntax of this setting is explained in - core5. - Systemd installs /usr/lib/sysctl.d/50-coredump.conf which configures - kernel.core_pattern to invoke systemd-coredump. - This file may be masked or overridden to use a different setting following normal - sysctl.d5 - rules. - - The behavior of a specific program upon reception of a - signal is governed by a few factors which are described in detail - in core5. - In particular, the coredump will only be processed when the - related resource limits are high enough. For programs started by - systemd, those may be set using - LimitCore= (see - systemd.exec5). + 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 + gdb1. - The behaviour of systemd-coredump is configured through - /etc/systemd/coredump.conf and other configuration files. See - coredump.conf5 - for details. By default, systemd-coredump will log the coredump including a - backtrace if possible, and store the core (contents of process' memory contents) in an external - file on disk in /var/lib/systemd/coredump. + By default, systemd-coredump 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. - When the kernel invokes systemd-coredump to handle a coredump, + When the kernel invokes systemd-coredump to handle a core dump, it will connect to the socket created by the systemd-coredump.socket unit, which in turn will spawn a systemd-coredump@.service instance - to process the coredump. Hence systemd-coredump.socket + to process the core dump. Hence systemd-coredump.socket and systemd-coredump@.service are helper units which do the actual - processing of coredumps and are subject to normal service management. + processing of core dumps and are subject to normal service management. - The log entry and a backtrace are stored in the journal, and can be viewed with - journalctl1. - coredumpctl1 - may be used to list and extract coredumps or load them in - gdb1. + The behavior of a specific program upon reception of a signal is governed by a few + factors which are described in detail in + core5. + In particular, the core dump will only be processed when the related resource limits are sufficient. + - The coredump helper is invoked anew each time. Therefore, any configuration - changes will take effect on the invocation of systemd-coredump. + + Configuration + For programs started by systemd process resource limits can be set by directive + LimitCore=, see + systemd.exec5. + + + In order to be used systemd-coredump must be configured in + sysctl8 + parameter kernel.core_pattern. The syntax of this parameter is explained in + core5. + Systemd installs the file /usr/lib/sysctl.d/50-coredump.conf which configures + kernel.core_pattern accordingly. This file may be masked or overridden to use a different + setting following normal + sysctl.d5 + rules. If the sysctl configuration is modified, it must be updated in the kernel before it takes effect, see - systemd-sysctl8 + sysctl8 and - sysctl8. + systemd-sysctl8. + + The behaviour of systemd-coredump itself is configured through the configuration file + /etc/systemd/coredump.conf and corresponding snippets + /etc/systemd/coredump.conf.d/*.conf, see + coredump.conf5. A new + instance of systemd-coredump is invoked upon receiving every core dump. Therefore, changes + in these files will take effect the next time a core dump is received. + + 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 systemd-tmpfiles, + corresponding settings are by default in /usr/lib/tmpfiles.d/systemd.conf. + + + + Usage + Data stored in the journal can be viewed with + journalctl1 + as usual. + coredumpctl1 + 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). @@ -119,6 +136,7 @@ coredump.conf5, coredumpctl1, systemd-journald.service8, + systemd-tmpfiles8, core5, sysctl.d5, systemd-sysctl.service8. -- cgit v1.2.3-54-g00ecf