[mythtv-users] Inhibit crash dumps (fixed)

Keith Pyle kpyle at austin.rr.com
Sun May 10 16:29:39 UTC 2020


On 05/10/20 07:00, John <jksjdevelop at gmail.com> wrote:
> On 10/05/2020 10:37, Stephen Worthington wrote:
>> On Sun, 10 May 2020 09:58:45 +0100, you wrote:
>>
>>> MythTV Version : v31.0-38-ga2b8c262dc on Ubuntu 20.04
>>>
>>> The frontend is working fine but crashing on exit. This occurs on one of
>>> my frontends but not others.
>>>
>>> mythshutdown also core dumps on exit when running on my Ubuntu 19.10 server.
>>>
>>> Both work fine but on one of my frontends it keeps creating a large core
>>> dump file in /var/crash
>>>
>>> ie /var/crash/usr_bin_mythfrontend.real.1000.crash
>>>
>>> Does any body know how to stop the core dump files being created
>> I think that involves the ulimit command to set the crash dump file
>> size to 0.  And if you look at /etc/security/limits.d/ (in Ubuntu), I
>> think you can add a config file there to match a program and provide
>> individual settings for it.  But I have not actually ever done that,
>> so google to see the right way of doing it.
>>
>> <snip>

> Setting limits.conf in /etc/security/limits.d to
> * soft core 0
> * hard core 0
> worked
>
Just be aware that /etc/security/limits.d settings apply to *everything* on the system, so you won't get core files for any crashes and a non-root user cannot override these settings.  If you want to apply the 'no core' controls to just one program, like mythfrontend, you can put the appropriate ulimit commands in a script that then exec's the program.  Something like:

#!/bin/bash
ulimit -c 0
exec /bin/ls

One extra Linux hint: If you don't like where core files are being placed, you can define a location with the kernel.core_pattern sysctl setting.  For example:

kernel.core_pattern = /tmp/%u-%s-%t-%e-%p.core

This pattern generates a name with the process uid, signal, time, executable name, and pid.  See the core(5) man page  for details on all of the % interpolations.

Keith



More information about the mythtv-users mailing list