2

I need to limit the total core files sizes generated to be 10% of my disk usage. I have set ulimit -c to be unlimited stating that each file size is unlimited. Then I used the configuration file /etc/systemd/coredump.conf.d/custom.conf to set

[Coredump]
Storage=external
#Compress=yes
#ProcessSizeMax=2G
#ExternalSizeMax=2G
#JournalSizeMax=767M
MaxUse=10
#KeepFree=15

I thought this configuration file will limit the disk usage to 10%. But still the core file usage exceeds 10%.

I tried setting the Storage=none, but still I got the core files generated. Setting the ulimit -c to 0 stopped generating core files. But I want the disk usage to be 10%. Is there anything I'm missing ?

1
  • Does /proc/sys/kernel/core_pattern contain |/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e, or something else? Commented Sep 25, 2016 at 2:36

1 Answer 1

1

MaxUse=10 actually says to clean all the older dumps if the total size of dumps exceeds 10bytes.

As per the source code which is mentioned in the link below: https://github.com/systemd/systemd/blob/4e4e3d97664163267d8295e6f58e0ff8560bea33/src/basic/parse-util.c#L109

It looks like the MaxUse is an argument which takes Size and NOT percentage, looks like the man page is little misleading here.

The MaxUse takes only size and it should be either of the suffixes mentioned in this set -> {"E","P","T","G","M","K","B",""} .

Any number without the suffix will be by default considered as Bytes.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.