journald: copy metrics/compression state from template when rotating
This commit is contained in:
@@ -1740,6 +1740,11 @@ int journal_file_open(
|
||||
f->writable = (flags & O_ACCMODE) != O_RDONLY;
|
||||
f->prot = prot_from_flags(flags);
|
||||
|
||||
if (template) {
|
||||
f->metrics = template->metrics;
|
||||
f->compress = template->compress;
|
||||
}
|
||||
|
||||
f->path = strdup(fname);
|
||||
if (!f->path) {
|
||||
r = -ENOMEM;
|
||||
|
||||
@@ -308,8 +308,6 @@ static JournalFile* find_journal(Server *s, uid_t uid) {
|
||||
return s->system_journal;
|
||||
|
||||
server_fix_perms(s, f, uid);
|
||||
f->metrics = s->system_metrics;
|
||||
f->compress = s->compress;
|
||||
|
||||
r = hashmap_put(s->user_journals, UINT32_TO_PTR(uid), f);
|
||||
if (r < 0) {
|
||||
|
||||
Reference in New Issue
Block a user