Commit Graph

6 Commits

Author SHA1 Message Date
Franck Bui 47cf786c0a coredump: rely on /proc exclusively to get the name of the crashing process
I couldn't see any reason why the kernel could provide COMM to the coredump
handler via the core_pattern command line but could not make it available in
/proc. So let's assume that this info is always available in /proc.

For "backtrace" mode (when --backtrace option is passed), I assumed that the
crashing process still exists at the time systemd-coredump is called.

Also changing the core_pattern line is an API breakage for any users of the
backtrace mode but given that systemd-coredump is installed in
/usr/lib/systemd, it's a private tool which has no internal users. At least no
one complained when the hostname was added to the core_pattern line
(f45b801551)...

Indeed it's much easier to get it from /proc since the kernel substitutes '%e'
specifier with multiple strings if the process name contains spaces (!).
2019-06-26 11:17:23 +02:00
Jakub Filak f45b801551 coredump: accept hostname on command line (#8033)
This commint adds a new command line parameter to sytemd-coredump. The
parameter should be mappend to core_pattern's placeholder %h - hostname.

The field _HOSTNAME holds the name from the kernel's namespaces which might be
different then the one comming from process' namespaces.

It is true that the real hostname is usually available in the field
COREDUMP_ENVIRON (environment variables) but I believe it is more reliable to
use the value passed by kernel.

----

The length of iovec is no longer static and hence I corrected the declarations
of the functions set_iovec_field and set_iovec_field_free.

Thank you @yuwata and @poettering!
2018-02-15 12:12:46 +01:00
Lennart Poettering bdfd7b2c63 coredump: honour RLIMIT_CORE when saving/processing coredumps
With this change processing/saving of coredumps takes the RLIMIT_CORE resource limit of the crashing process into
account, given the user control whether specific processes shall core dump or not, and how large to make the core dump.

Note that this effectively disables core-dumping for now, as RLIMIT_CORE defaults to 0 (i.e. is disabled) for all
system processes.
2016-02-10 16:08:32 +01:00
Lennart Poettering d1fcdcd87a sysctl: use %P instead of %p in core pattern
That way we'll get the PID on the host, rather than the one in a PID
namespace. Which should make the coredump handler less confusing.

Fixes #1930.
2015-11-17 17:32:49 +01:00
Zbigniew Jędrzejewski-Szmek 5146e7e8ae man: add systemd-coredump(8) and a bunch of links 2014-07-13 21:11:07 -04:00
Kay Sievers 94c525f076 sysctl: coredump.conf -> 50-coredump.conf 2013-03-15 15:59:21 +01:00
Renamed from sysctl.d/coredump.conf.in (Browse further)