]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: make sure we vacuum by default
authorLennart Poettering <lennart@poettering.net>
Fri, 15 May 2015 18:56:55 +0000 (20:56 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 15 May 2015 18:56:55 +0000 (20:56 +0200)
Only if both keep_free and max_use are actually 0 we can shortcut things
and avoid vacuuming. If either are positive or -1 we need to execute the
vacuuming.

http://lists.freedesktop.org/archives/systemd-devel/2015-April/031382.html

man/coredump.conf.xml
src/journal/coredump-vacuum.c

index 0b7329bf5563c3e7d5766eb8567f0c52b91a07b2..fd54c59e6bc97106c3a0fdbf6b13a24e8869da29 100644 (file)
         by coredumps might temporarily exceed these limits while
         coredumps are processed. Note that old coredumps are also
         removed based on time via
-        <citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
+        <citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Set
+        either value to 0 to turn off size based
+        clean-up.</para></listitem>
       </varlistentry>
     </variablelist>
 
index 9b73795e5bb27843a5bbef60c4febce84a0b6920..c0347ef5690e4f4ebc7e75139e16b3a55e0c95a5 100644 (file)
@@ -103,8 +103,7 @@ static bool vacuum_necessary(int fd, off_t sum, off_t keep_free, off_t max_use)
 
                         if (max_use < DEFAULT_MAX_USE_LOWER)
                                 max_use = DEFAULT_MAX_USE_LOWER;
-                }
-                else
+                } else
                         max_use = DEFAULT_MAX_USE_LOWER;
         } else
                 max_use = PAGE_ALIGN(max_use);
@@ -135,7 +134,7 @@ int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
         struct stat exclude_st;
         int r;
 
-        if (keep_free <= 0 && max_use <= 0)
+        if (keep_free == 0 && max_use == 0)
                 return 0;
 
         if (exclude_fd >= 0) {