]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: add remote log dir to search path when --merge is passed (#4970)
authorMarcin Bachry <hegel666@gmail.com>
Fri, 23 Dec 2016 23:42:13 +0000 (00:42 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Dec 2016 23:42:13 +0000 (00:42 +0100)
The journalctl man page says: "-m, --merge Show entries interleaved from all
available journals, including remote ones.", but current version of journalctl
doesn't live up to this promise. This patch simply adds
"/var/log/journal/remote" to search path if --merge flag is used.

Should fix issue #3618

src/journal/sd-journal.c

index 56257c41d4221f1cd66879d30e966434a1cf218e..71967a0f3330573056a50a26eb0ada690435ae7e 100644 (file)
@@ -1661,6 +1661,9 @@ static int add_search_paths(sd_journal *j) {
         NULSTR_FOREACH(p, search_paths)
                 (void) add_root_directory(j, p, true);
 
+        if (!(j->flags & SD_JOURNAL_LOCAL_ONLY))
+                (void) add_root_directory(j, "/var/log/journal/remote", true);
+
         return 0;
 }