summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-04 02:33:11 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-04 02:33:11 +0100
commitb1a0ab714863ae77e4683820757b3f49c03a0049 (patch)
tree540fc4c89aba5edf2ddfc3fe108f0e3e0f66c3e7
parenta99c349d0d54ca4946c6f81670ab9890f2b4f497 (diff)
journald: don't rotate on startup
-rw-r--r--src/journal/journald.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c
index b42be8d7ad..47fe6edb0c 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -306,14 +306,11 @@ static JournalFile* find_journal(Server *s, uid_t uid) {
return f;
}
-static void server_vacuum(Server *s) {
- Iterator i;
+static void server_rotate(Server *s) {
+ JournalFile *f;
void *k;
- char *p;
- char ids[33];
- sd_id128_t machine;
+ Iterator i;
int r;
- JournalFile *f;
log_info("Rotating...");
@@ -336,6 +333,13 @@ static void server_vacuum(Server *s) {
else
hashmap_replace(s->user_journals, k, f);
}
+}
+
+static void server_vacuum(Server *s) {
+ char *p;
+ char ids[33];
+ sd_id128_t machine;
+ int r;
log_info("Vacuuming...");
@@ -565,6 +569,7 @@ retry:
if (r == -E2BIG && !vacuumed) {
log_info("Allocation limit reached.");
+ server_rotate(s);
server_vacuum(s);
vacuumed = true;
@@ -1308,6 +1313,7 @@ static int server_flush_to_var(Server *s) {
log_info("Allocation limit reached.");
journal_file_post_change(s->system_journal);
+ server_rotate(s);
server_vacuum(s);
r = journal_file_copy_entry(f, s->system_journal, o, f->current_offset, NULL, NULL, NULL);