[systemd-devel] How to generate core file in system service

Xin Long lucien.xin at gmail.com
Wed Sep 27 12:49:33 UTC 2017


On Mon, Sep 25, 2017 at 2:47 PM, Mantas Mikulėnas <grawity at gmail.com> wrote:
> On Mon, Sep 25, 2017 at 8:59 AM, Xin Long <lucien.xin at gmail.com> wrote:
>>
>> Hi,
>>
>> linux network is using
>>   systemctl start teamd at 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 teamd at team0.service, no core file was
>> generate when it crashed, but only get:
>>    "systemd: teamd at 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 ?
>
>
> 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.)
>
> --
> Mantas Mikulėnas <grawity at gmail.com>


More information about the systemd-devel mailing list