Discussion:
How to generate core file in system service
(too old to reply)
Xin Long
2017-09-25 05:59:02 UTC
Permalink
Raw Message
Hi,

linux network is using
systemctl start ***@team0.service
to start a teamd service, which will call teamd.

I got a teamd issue to debug, I wanted generate core file by adding abort()
in teamd and ulimit -c unlimited.

But when I start the deamon by "teamd" directly, I could get core file.
When I start it by systemctl start ***@team0.service, no core file was
generate when it crashed, but only get:
"systemd: ***@team0.service: main process exited, code=killed,
status=6/ABRT"
in /var/log/messages.

I'm just wondering if there is a way to generate the core file when the
the program crashes even if I start it as a systeamd service ?

Thanks.
Mantas Mikulėnas
2017-09-25 06:47:20 UTC
Permalink
Raw Message
Post by Xin Long
Hi,
linux network is using
to start a teamd service, which will call teamd.
I got a teamd issue to debug, I wanted generate core file by adding abort()
in teamd and ulimit -c unlimited.
But when I start the deamon by "teamd" directly, I could get core file.
status=6/ABRT"
in /var/log/messages.
I'm just wondering if there is a way to generate the core file when the
the program crashes even if I start it as a systeamd service ?
Yes, everything works the same way – `ulimit -c` corresponds to LimitCORE=,
so make sure that's set to unlimited in your service.

(Remember that services are spawned by init, not by systemctl, so ulimits
don't carry over directly.)
--
Mantas Mikulėnas <***@gmail.com>
Miroslav Suchý
2017-09-25 08:26:48 UTC
Permalink
Raw Message
Post by Xin Long
But when I start the deamon by "teamd" directly, I could get core file.
status=6/ABRT"
in /var/log/messages.
I guess this crash has been caught by ABRT.

Try:
abrt-cli list

And then start here:
http://abrt.readthedocs.io/en/latest/faq.html

If you would enable micro report (here is how https://wiki.centos.org/TipsAndTricks/ABRT ) it would automatically appear
here:
https://retrace.fedoraproject.org/faf/reports/?component_names=libteam&associate=__None

Mirek
Mantas Mikulėnas
2017-09-25 08:32:23 UTC
Permalink
Raw Message
Post by Miroslav Suchý
Post by Xin Long
But when I start the deamon by "teamd" directly, I could get core file.
status=6/ABRT"
in /var/log/messages.
I guess this crash has been caught by ABRT.
abrt-cli list
Even though abrt got its name from SIGABRT, doesn't mean it handles all
abort()-induced crashes...
--
Mantas Mikulėnas <***@gmail.com>
Kai Krakow
2017-09-26 23:36:54 UTC
Permalink
Raw Message
Am Mon, 25 Sep 2017 10:26:48 +0200
Post by Miroslav Suchý
Post by Xin Long
But when I start the deamon by "teamd" directly, I could get core
status=6/ABRT"
in /var/log/messages.
I guess this crash has been caught by ABRT.
abrt-cli list
Also try "coredumpctl list". Maybe systemd-coredump did catch the dump.

This is the case if sysctl kernel.core_pattern pipes to
/lib/systemd/systemd-coredump.
--
Regards,
Kai

Replies to list-only preferred.
Lennart Poettering
2017-09-27 07:52:48 UTC
Permalink
Raw Message
Post by Kai Krakow
Am Mon, 25 Sep 2017 10:26:48 +0200
Post by Miroslav Suchý
Post by Xin Long
But when I start the deamon by "teamd" directly, I could get core
status=6/ABRT"
in /var/log/messages.
I guess this crash has been caught by ABRT.
abrt-cli list
Also try "coredumpctl list". Maybe systemd-coredump did catch the dump.
The exit status in the log message above indicates that no coredump
was collected, because in that case the exit code would have to be
"dumped" instead of "killed" as shown.

Lennart
--
Lennart Poettering, Red Hat
Xin Long
2017-09-27 12:49:33 UTC
Permalink
Raw Message
Post by Xin Long
Hi,
linux network is using
to start a teamd service, which will call teamd.
I got a teamd issue to debug, I wanted generate core file by adding abort()
in teamd and ulimit -c unlimited.
But when I start the deamon by "teamd" directly, I could get core file.
status=6/ABRT"
in /var/log/messages.
I'm just wondering if there is a way to generate the core file when the
the program crashes even if I start it as a systeamd service ?
Yes, everything works the same way – `ulimit -c` corresponds to LimitCORE=,
so make sure that's set to unlimited in your service.
Works for me, thanks for your fast reply.
(Remember that services are spawned by init, not by systemctl, so ulimits
don't carry over directly.)
--
Loading...