summaryrefslogtreecommitdiff
path: root/src/journal/journald-server.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-05 02:09:01 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-05 02:57:36 +0100
commit2678031a179a9b91fc799f8ef951a548c66c4b49 (patch)
treeaf167864ad6f6110bb3a2343f8c58f0bfa53e07d /src/journal/journald-server.c
parentaba843317d8acc4634417becebaedcfe5805d49d (diff)
journald: when we detect the journal file we are about to write to has been deleted, rotate
https://bugzilla.redhat.com/show_bug.cgi?id=1171719
Diffstat (limited to 'src/journal/journald-server.c')
-rw-r--r--src/journal/journald-server.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 019c3a649a..c28aba8fd0 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -318,6 +318,7 @@ static int do_rotate(
log_error_errno(r, "Failed to create new %s journal: %m", name);
else
server_fix_perms(s, *f, uid);
+
return r;
}
@@ -466,7 +467,8 @@ static bool shall_try_append_again(JournalFile *f, int r) {
-EPROTONOSUPPORT Unsupported feature
-EBADMSG Corrupted
-ENODATA Truncated
- -ESHUTDOWN Already archived */
+ -ESHUTDOWN Already archived
+ -EIDRM Journal file has been deleted */
if (r == -E2BIG || r == -EFBIG || r == -EDQUOT || r == -ENOSPC)
log_debug("%s: Allocation limit reached, rotating.", f->path);
@@ -480,6 +482,8 @@ static bool shall_try_append_again(JournalFile *f, int r) {
log_warning("%s: Journal file corrupted, rotating.", f->path);
else if (r == -EIO)
log_warning("%s: IO error, rotating.", f->path);
+ else if (r == -EIDRM)
+ log_warning("%s: Journal file has been deleted, rotating.", f->path);
else
return false;