From 485fd9a7b9d59b9f2302a873f7ee5ccac256dd93 Mon Sep 17 00:00:00 2001 From: Michal Sekletar Date: Wed, 3 Feb 2016 11:22:52 +0100 Subject: [PATCH 1/2] journalctl: add match for the current boot when called with devpath --- src/journal/journalctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index cf359d20ca..bdfe7e8750 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -218,6 +218,10 @@ static int add_matches_for_device(sd_journal *j, const char *devpath) { d = udev_device_get_parent(d); } + r = add_match_this_boot(j, arg_machine); + if (r < 0) + return log_error_errno(r, "Failed to add match for the current boot: %m"); + return 0; } From 3cea8e06e45fc1757de8f74da29fb5fb181db4eb Mon Sep 17 00:00:00 2001 From: Michal Sekletar Date: Wed, 3 Feb 2016 10:38:29 +0100 Subject: [PATCH 2/2] man: clarify what happens when journalctl is called with devpath --- man/journalctl.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/man/journalctl.xml b/man/journalctl.xml index b57afb6ebf..7ad3ff60cf 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -91,8 +91,14 @@ paths may be specified. If a file path refers to an executable file, this is equivalent to an _EXE= match for the canonicalized binary path. Similarly, if a path refers - to a device node, this is equivalent to a - _KERNEL_DEVICE= match for the device. + to a device node then match is added for the kernel name of the + device (_KERNEL_DEVICE=). Also, matches for the + kernel names of all the parent devices are added automatically. + Device node paths are not stable across reboots, therefore match + for the current boot id (_BOOT_ID=) is + always added as well. Note that only the log entries for + the existing device nodes maybe queried by providing path to + the device node. Additional constraints may be added using options , , etc., to