Merge pull request #2519 from msekletar/journalctl-device-log-current-boot-v2

journalctl: add match for the current boot when called with devpath (v2)
This commit is contained in:
Lennart Poettering 2016-02-03 16:26:21 +01:00
commit a92ff4003f
2 changed files with 12 additions and 2 deletions

View file

@ -91,8 +91,14 @@
paths may be specified. If a file path refers to an executable
file, this is equivalent to an <literal>_EXE=</literal> match
for the canonicalized binary path. Similarly, if a path refers
to a device node, this is equivalent to a
<literal>_KERNEL_DEVICE=</literal> match for the device.</para>
to a device node then match is added for the kernel name of the
device (<literal>_KERNEL_DEVICE=</literal>). 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 (<literal>_BOOT_ID=</literal>) 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.</para>
<para>Additional constraints may be added using options
<option>--boot</option>, <option>--unit=</option>, etc., to

View file

@ -220,6 +220,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;
}