From: Zbigniew Jędrzejewski-Szmek Date: Tue, 5 Dec 2023 14:56:54 +0000 (+0100) Subject: coredump: keep core files for two weeks X-Git-Tag: v256-rc1~1587 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8d67130b8b492a1f2eedd07a3189051f98db648;p=thirdparty%2Fsystemd.git coredump: keep core files for two weeks We have two mechanisms that remove old coredumps: systemd-coredump has parameters based on disk use / remaining disk free, and systemd-tmpfiles does cleanup based on time. The first mechanism should prevent us from using too much disk space in case something is crashing continuously or there are very large core files. The limit of 3 days makes it likely that the core file will be gone by the time the admin looks at the issue. E.g. if something crashes on Friday, the coredump would likely be gone before people are back on Monday to look at it. --- diff --git a/tmpfiles.d/systemd.conf.in b/tmpfiles.d/systemd.conf.in index 3781c579e04..11a45a3f4bb 100644 --- a/tmpfiles.d/systemd.conf.in +++ b/tmpfiles.d/systemd.conf.in @@ -59,7 +59,7 @@ a+ /var/log/journal/%m/system.journal - - - - group:wheel:r-- {% endif %} d /var/lib/systemd 0755 root root - -d /var/lib/systemd/coredump 0755 root root 3d +d /var/lib/systemd/coredump 0755 root root 2w # Files and directories in /var/lib/systemd/ephemeral-trees are locked by pid 1 to prevent tmpfiles from # removing them, and tmpfiles is told to clean up anything in /var/lib/systemd/ephemeral-trees that isn't # locked unconditionally.