Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no core dump generated for systemd service

I want to enable core dump generation for a systemd service which gives a SEGV status and exits.

scd.service: main process exited, code=killed, status=11/SEGV

Unit scd.service entered failed state.

scd.service failed.

my bashrc file already has ulimit -c unlimited.

after running systemd-coredumpctl the output is

No coredumps found.

Note : I am able to generate core dump for normal programs executed via terminal but unable to do so for a systemd service

like image 400
Yashgiri Goswami Avatar asked Jan 17 '18 10:01

Yashgiri Goswami


People also ask

Where is systemd core dump?

By default, systemd-coredump will log the core dump to the journal, including a backtrace if possible, and store the core dump (an image of the memory contents of the process) itself in an external file in /var/lib/systemd/coredump . These core dumps are deleted after a few days by default; see /usr/lib/tmpfiles.

Where is the core dump file?

The storage system stores the core dump file in the /etc/crash directory on the root volume. The savecore command, which is included in the default /etc/rc file on the root volume, performs the following tasks: Produces a core.


1 Answers

You need to set LimitCORE=infinity in your service file (scd.service), not your bashrc.

More info in https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Process%20Properties

like image 141
aleivag Avatar answered Sep 19 '22 15:09

aleivag