Skip to content

Journal polling not working on Ubuntu 24.04 #146

@SkytAsul

Description

@SkytAsul

This code was working on Ubuntu 22.04, with python3-systemd version 234:

    j = systemd.journal.Reader()
    j.this_boot()
    j.log_level(systemd.journal.LOG_INFO)
    j.add_match(SYSLOG_IDENTIFIER="kernel")

    # Seek to the end of the journal to only capture new entries
    j.seek_tail()

    while True:
        if j.wait(10):
            for entry in j:
              # do things

But on Ubuntu 24.04 and python3-systemd version 235, it is not working anymore. Especially, the "for" loop does not encounter any item. If we try to run next(j) it immediately raises StopIteration, even if j.wait(timeout) returned APPEND.

I also tried the "Example: polling for journal events" code from the documentation (https://www.freedesktop.org/software/systemd/python-systemd/journal.html#example-polling-for-journal-events) and it is not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions