[systemd-bugs] [Bug 63277] New: journalctl -b doesn't do what is expected when there are explicit disjunctions

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Apr 8 10:47:58 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=63277

          Priority: medium
            Bug ID: 63277
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: journalctl -b doesn't do what is expected when there
                    are explicit disjunctions
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: marius.vollmer at redhat.com
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

I expect "-b" to never output entries that don't belong to the current boot,
but when there are explicit disjunctions in the match expression, it gets
confused.

This is correct:

   # journalctl -b -o verbose | grep _BOOT_ID | sort | uniq
    _BOOT_ID=e2e2a996e7da4fb28d56f12a9c8a5261

(only one boot id)

but this isn't:

   # journalctl -b -o verbose _PID=2 + _PID=1 | grep _BOOT_ID | sort | uniq
    _BOOT_ID=1e128df28b734458a797870d84a806ee
    _BOOT_ID=361717ded01e4a3d896f52f3bbd9cde7
    _BOOT_ID=6805fcfa65334dd188c78e54962c2f2e
    _BOOT_ID=7af680e2259a4af0b81a948950d3046b
    _BOOT_ID=91283683ba8b4164b8bde31498f85d4e
    _BOOT_ID=e2e2a996e7da4fb28d56f12a9c8a5261

(many boot ids)

I guess this happens because "-b" just adds a single "_BOOT_ID=..." match which
results in an effective match expression of 

  (_BOOT_ID=... && _PID=2) || (_PID=1)

in the last case.

To fix this, the _BOOT_ID_... match needs to _also_ be added after each call to
sd_journal_add_disjunction, I think.  Patch with pleasure on request.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20130408/9699c29e/attachment.html>


More information about the systemd-bugs mailing list