]> git.ipfire.org Git - thirdparty/systemd.git/commit
coredump: rely on /proc exclusively to get the name of the crashing process
authorFranck Bui <fbui@suse.com>
Fri, 21 Jun 2019 11:12:41 +0000 (13:12 +0200)
committerFranck Bui <fbui@suse.com>
Wed, 26 Jun 2019 09:17:23 +0000 (11:17 +0200)
commit47cf786c0a13fccd777c334bed4b1e7b02f18d42
treef85199d6d6d48669f3433222609cf84f67c95371
parent57ae8f99360dd5bedcecb9c31a111e72fdb164dd
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
(f45b8015513)...

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 (!).
src/coredump/coredump.c
sysctl.d/50-coredump.conf.in