]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: keep core files for two weeks
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Dec 2023 14:56:54 +0000 (15:56 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Dec 2023 21:05:20 +0000 (22:05 +0100)
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.

tmpfiles.d/systemd.conf.in

index 3781c579e047440165dbb8778898a20bddb626ec..11a45a3f4bb76f3eea53895add7f5e07931c19ce 100644 (file)
@@ -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.