[OE-core] [PATCH v2] systemd: Allow custom coredump config options

ChenQi Qi.Chen at windriver.com
Tue Jul 24 02:52:50 UTC 2018


On 07/24/2018 07:16 AM, Alistair Francis wrote:
> On Wed, Jul 18, 2018 at 4:48 PM, Andre McCurdy <armccurdy at gmail.com> wrote:
>> On Wed, Jul 18, 2018 at 3:53 PM, Alistair Francis
>> <alistair.francis at wdc.com> wrote:
>>> If the user has enabled coredump let's allow them to customise the
>>> config options.
>>>
>>> Signed-off-by: Alistair Francis <alistair.francis at wdc.com>
>>> ---
>>>   meta/recipes-core/systemd/systemd_239.bb | 12 ++++++++++++
>>>   1 file changed, 12 insertions(+)
>>>
>>> diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_239.bb
>>> index 7822548993..a625d060a9 100644
>>> --- a/meta/recipes-core/systemd/systemd_239.bb
>>> +++ b/meta/recipes-core/systemd/systemd_239.bb
>>> @@ -279,6 +279,18 @@ do_install() {
>>>                          chown polkitd:root ${D}${datadir}/polkit-1/rules.d
>>>                  fi
>>>          fi
>>> +
>>> +  # If coredump was enabled, enable it in the config.
>>> +  # This just sets the default, but can be used to customise the values.
>>> +  if ${@bb.utils.contains('PACKAGECONFIG', 'coredump', 'true', 'false', d)}; then
>>> +    sed 's|#Storage.*|Storage=external|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> +    sed 's|#Compress.*|Compress=yes|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> +    sed 's|#ProcessSizeMax.*|ProcessSizeMax=2G|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> +    sed 's|#ExternalSizeMax.*|ExternalSizeMax=2G|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> +    sed 's|#JournalSizeMax.*|JournalSizeMax=767M|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> +    sed 's|#MaxUse.*|MaxUse=|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> +    sed 's|#KeepFree.*|KeepFree=|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>> How does this allow the user to customise the config options?
> They can edit the sed command line and have different options.
>
>> By forcing the options to the _current_ default values you are
>> creating a maintenance problem - ie you'll still be forcing these
>> values even if/when the upstream defaults are changed.
> That is a good point, is there a usual way to allow edits to config
> files like this?
>
> Alistair
>

It depends on what package you are modifying, as different packages have 
different ways to handle their configuration. It also depends on what 
configuration you are going to customize, maybe the config customization 
is generally wanted by most users, maybe it's not.

Back to this systemd coredump case, the best way to customize things is 
to drop in configuration files to /etc/systemd/coredump.conf.d/ via 
bbappend.
https://www.freedesktop.org/software/systemd/man/coredump.conf.html

Best Regards,
Chen Qi

>>> +  fi
>>>   }
>>>
>>>
>>> --
>>> 2.17.1
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core at lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core





More information about the Openembedded-core mailing list