]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: fixed bug - some coredump temp files could be lost
authorKrayushkin Konstantin <kkrayushkin@lintech.ru>
Fri, 31 May 2019 08:16:17 +0000 (11:16 +0300)
committerLennart Poettering <lennart@poettering.net>
Fri, 31 May 2019 10:57:35 +0000 (12:57 +0200)
If the machine was suddenly shutted down (hard reboot for example) while
processing core dump, temp files created manually (not with a O_TEMPFILE flag)
stay in the system. After reboot systemd-coredump treat them as usual files, so
they wouldn't be rotated and shall pollute the filesystem.

Solution is to simply add those temp files to systemd-tmpfiles configs.

tmpfiles.d/systemd-tmp.conf

index beb77dd0e000d934614a4ee27aabdc0b74d378f4..d47d468fba86ba0ef22031563903d291bc9167ff 100644 (file)
@@ -16,3 +16,8 @@ X /var/tmp/systemd-private-%b-*/tmp
 # Remove top-level private temporary directories on each boot
 R! /tmp/systemd-private-*
 R! /var/tmp/systemd-private-*
+
+# Handle lost systemd-coredump temp files. They could be lost on old filesystems,
+# for example, after hard reboot.
+x  /var/lib/systemd/coredump/.#core*.%b*
+r! /var/lib/systemd/coredump/.#*