diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-01-24 19:19:33 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-01-24 19:19:33 -0500 |
commit | 4761fd0ffb0d58efb2ad00775aba54f76a8a26ea (patch) | |
tree | 0e3c88de2fb1949460044a49c1dca5d6a6b80f47 /src/journal | |
parent | 4214009f8a226b43fd11bb24de29bcf44b9e1f4a (diff) |
journal-file, journalctl: provide better hint about unsupported features
https://bugzilla.redhat.com/show_bug.cgi?id=1416201
$ journalctl -b
Journal file /var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~ uses an unsupported feature, ignoring file.
Use SYSTEMD_LOG_LEVEL=debug journalctl --file=/var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~ to see the details.
-- No entries --
$ journalctl --file=/var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~
Journal file /var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~ uses incompatible flag lz4-compressed disabled at compilation time.
Failed to open journal file /var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~: Protocol not supported
mmap cache statistics: 0 hit, 1 miss
Failed to open files: Protocol not supported
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/journal-file.c | 24 | ||||
-rw-r--r-- | src/journal/journalctl.c | 4 |
2 files changed, 23 insertions, 5 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index d67b597af9..7fcb30aa7b 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -42,6 +42,7 @@ #include "sd-event.h" #include "set.h" #include "string-util.h" +#include "strv.h" #include "xattr-util.h" #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem)) @@ -517,12 +518,27 @@ static bool warn_wrong_flags(const JournalFile *f, bool compatible) { if (flags & ~supported) { if (flags & ~any) - log_debug("Journal file %s has unknown %s flags %"PRIx32, + log_debug("Journal file %s has unknown %s flags 0x%"PRIx32, f->path, type, flags & ~any); flags = (flags & any) & ~supported; - if (flags) - log_debug("Journal file %s uses %s flags %"PRIx32" disabled at compilation time.", - f->path, type, flags); + if (flags) { + const char* strv[3]; + unsigned n = 0; + _cleanup_free_ char *t = NULL; + + if (compatible && (flags & HEADER_COMPATIBLE_SEALED)) + strv[n++] = "sealed"; + if (!compatible && (flags & HEADER_INCOMPATIBLE_COMPRESSED_XZ)) + strv[n++] = "xz-compressed"; + if (!compatible && (flags & HEADER_INCOMPATIBLE_COMPRESSED_LZ4)) + strv[n++] = "lz4-compressed"; + strv[n] = NULL; + assert(n < ELEMENTSOF(strv)); + + t = strv_join((char**) strv, ", "); + log_debug("Journal file %s uses %s %s %s disabled at compilation time.", + f->path, type, n > 1 ? "flags" : "flag", strnull(t)); + } return true; } diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 2a5f2b37e8..2639fd6cf5 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1910,7 +1910,9 @@ static int access_check(sd_journal *j) { break; case EPROTONOSUPPORT: - log_warning_errno(err, "Journal file %s uses an unsupported feature, ignoring file.", path); + log_warning_errno(err, "Journal file %1$s uses an unsupported feature, ignoring file.\n" + "Use SYSTEMD_LOG_LEVEL=debug journalctl --file=%1$s to see the details.", + path); break; case EBADMSG: |