summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Albers <daniel@lbe.rs>2013-05-31 14:39:34 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-06-01 09:15:11 -0400
commitfe1abefcd3bf1718dde3b5b835db56142c9f7082 (patch)
tree4175ff0b047ede0d95026a5819311cc6b03ac074
parent1a2a4cf250adc7f8caf0e43963db3547e330b929 (diff)
journal: take KeepFree into account when reporting maximum size
When reporting the maximum journal size add a hint if it's limited by KeepFree.
-rw-r--r--src/journal/journald-server.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index da5b725863..0bf557c809 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -780,6 +780,9 @@ static int system_journal_open(Server *s) {
char *fn;
sd_id128_t machine;
char ids[33];
+ uint64_t avail;
+
+ avail = available_space(s);
r = sd_id128_get_machine(&machine);
if (r < 0)
@@ -821,6 +824,10 @@ static int system_journal_open(Server *s) {
server_driver_message(s, SD_ID128_NULL, "Allowing system journal files to grow to %s.",
format_bytes(fb, sizeof(fb), s->system_metrics.max_use));
+ if (s->system_metrics.max_use > avail)
+ server_driver_message(s, SD_ID128_NULL, "Journal size currently limited to %s due to SystemKeepFree.",
+ format_bytes(fb, sizeof(fb), avail));
+
} else if (r < 0) {
if (r != -ENOENT && r != -EROFS)
@@ -874,6 +881,10 @@ static int system_journal_open(Server *s) {
server_fix_perms(s, s->runtime_journal, 0);
server_driver_message(s, SD_ID128_NULL, "Allowing runtime journal files to grow to %s.",
format_bytes(fb, sizeof(fb), s->runtime_metrics.max_use));
+
+ if (s->system_metrics.max_use > avail)
+ server_driver_message(s, SD_ID128_NULL, "Journal size currently limited to %s due to RuntimeKeepFree.",
+ format_bytes(fb, sizeof(fb), avail));
}
}