Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Log core dump files on systemd/Ubuntu?


> On Apr 18, 2022, at 15:35, Travis Griggs <travisgriggs@xxxxxxxxx> wrote:
> 
> <snip>
>    # I added the following line
>    LimitCORE=infinity
> 
>    [Install]
>    WantedBy=multi-user.target
> 
> But for whatever reason, I'm still not getting a coredump in /var/lib/apport/coredump.
> 
> I wrote a tiny C program that sigseg's periodically and wrapped it in a systemd.service, and it dumps the coredump just fine (as long as I set the LimitCORE value appropriately). 
> 
> I'm just trying to get a feel for where the sigseg is originating at. Has anyone else figured out how to do this (capture the coredump file). Is there a better approach for this? I could shutdown the systemd service and just run it from the command line I guess?

I found that by adding

    User=mosquitto

also to the .service section, I finally got a coredump file in /var/lib/apport/coredump.

I admit I don't understand enough about ulimits and setuid and systemd and apport enough to explain why this change was necessary to get it to work.

I'm curious why this (setting the user in the service file) isn't done be default? I was kind of confused seeing that the mosquitto service did not set this, and yet the mosquitto process was running as the mosquitto user. It wasn't until I learned a little more about setuid and dug through the source that I saw where the program demotes itself. But on a systemd system, my not just start out as the right user?

I would submit a patch/pull with changes to mosquitto/service/systemd/mosquitto.service.[notify|simple] if there was support for that...

Back to the top