Systemd Core Dumps – How Can a Non-Root User Retrieve Core Dumps?

core-dumpnot-root-usersystemd

As we know, with systemd, core dumps don't just get written to the current directory but to some obscure journal. Now, I'm a poor old non-root user on some machine, and – I want my core dumps! I can't follow the suggestions to edit files in /etc or run systemd utilities as root. Can I still get my core dump files somehow?

PS – If it matters, I'm on Fedora 22.

Best Answer

Use systemd's coredumpctl to list and retrieve your core dumps. Use the PID or name of the program to select one to dump (to file -o ...) or to run gdb on.

$ coredumpctl list
TIME                            PID   UID   GID SIG PRESENT EXE
Mon 2016-04-11 11:18:23 CEST  21538  1000  1000  11 * /usr/bin/sleep
$ coredumpctl info 21538
           PID: 21538 (sleep)
           UID: 1000 (meuh)
           ...
$ coredumpctl -o core dump sleep
$ coredumpctl gdb 21538

(Some intermediate versions of systemd use the name systemd-coredumpctl). Your userid must be in group systemd-journal to be able to do this without becoming root.