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
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With