|
|
923a60 |
From c730efd5335cf49ef78008b7d49fc5d5215089eb Mon Sep 17 00:00:00 2001
|
|
|
923a60 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
923a60 |
Date: Fri, 15 May 2015 20:56:55 +0200
|
|
|
923a60 |
Subject: [PATCH] coredump: make sure we vacuum by default
|
|
|
923a60 |
|
|
|
923a60 |
Only if both keep_free and max_use are actually 0 we can shortcut things
|
|
|
923a60 |
and avoid vacuuming. If either are positive or -1 we need to execute the
|
|
|
923a60 |
vacuuming.
|
|
|
923a60 |
|
|
|
923a60 |
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031382.html
|
|
|
923a60 |
(cherry picked from commit 5470c03b37d8421a903564c2c8028c8b8d67d403)
|
|
|
923a60 |
|
|
|
923a60 |
Cherry-picked from: 5470c03
|
|
|
923a60 |
Resolves: #1222517
|
|
|
923a60 |
---
|
|
|
923a60 |
man/coredump.conf.xml | 4 +++-
|
|
|
923a60 |
src/journal/coredump-vacuum.c | 5 ++---
|
|
|
923a60 |
2 files changed, 5 insertions(+), 4 deletions(-)
|
|
|
923a60 |
|
|
|
923a60 |
diff --git a/man/coredump.conf.xml b/man/coredump.conf.xml
|
|
|
923a60 |
index 0b7329bf55..fd54c59e6b 100644
|
|
|
923a60 |
--- a/man/coredump.conf.xml
|
|
|
923a60 |
+++ b/man/coredump.conf.xml
|
|
|
923a60 |
@@ -134,7 +134,9 @@
|
|
|
923a60 |
by coredumps might temporarily exceed these limits while
|
|
|
923a60 |
coredumps are processed. Note that old coredumps are also
|
|
|
923a60 |
removed based on time via
|
|
|
923a60 |
- <citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
|
|
|
923a60 |
+ <citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Set
|
|
|
923a60 |
+ either value to 0 to turn off size based
|
|
|
923a60 |
+ clean-up.</para></listitem>
|
|
|
923a60 |
</varlistentry>
|
|
|
923a60 |
</variablelist>
|
|
|
923a60 |
|
|
|
923a60 |
diff --git a/src/journal/coredump-vacuum.c b/src/journal/coredump-vacuum.c
|
|
|
923a60 |
index 9b73795e5b..c0347ef569 100644
|
|
|
923a60 |
--- a/src/journal/coredump-vacuum.c
|
|
|
923a60 |
+++ b/src/journal/coredump-vacuum.c
|
|
|
923a60 |
@@ -103,8 +103,7 @@ static bool vacuum_necessary(int fd, off_t sum, off_t keep_free, off_t max_use)
|
|
|
923a60 |
|
|
|
923a60 |
if (max_use < DEFAULT_MAX_USE_LOWER)
|
|
|
923a60 |
max_use = DEFAULT_MAX_USE_LOWER;
|
|
|
923a60 |
- }
|
|
|
923a60 |
- else
|
|
|
923a60 |
+ } else
|
|
|
923a60 |
max_use = DEFAULT_MAX_USE_LOWER;
|
|
|
923a60 |
} else
|
|
|
923a60 |
max_use = PAGE_ALIGN(max_use);
|
|
|
923a60 |
@@ -135,7 +134,7 @@ int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
|
|
|
923a60 |
struct stat exclude_st;
|
|
|
923a60 |
int r;
|
|
|
923a60 |
|
|
|
923a60 |
- if (keep_free <= 0 && max_use <= 0)
|
|
|
923a60 |
+ if (keep_free == 0 && max_use == 0)
|
|
|
923a60 |
return 0;
|
|
|
923a60 |
|
|
|
923a60 |
if (exclude_fd >= 0) {
|