[systemd-devel] sd_journal_next always returns 0

kumaran ida kumaranida at gmail.com
Fri Jan 6 17:35:28 UTC 2017


I wants to listen to remote journal logs ( logs which we receive from
another machine, using systemd-journal-remote) and take some action
accordingly. For that I wrote a small application which opens remote
journal directory (sd_journal_open_directory
(j,"/var/log/journal/remote/",0) and parse through all the logs using
sd_journal_next() and whenever sd_journal_next returns 0 (no new logs), I
wait on sd_journal_wait().

I ran this process as root, sd_journal_wait() wakes up whenever journal
remote receives new logs but sd_journal_next always returns 0. But
journalctl works, it could able to read.

If I stop systemd-journal-remote and restart my application, My application
works properly, it reads all the logs properly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170106/b399249f/attachment.html>


More information about the systemd-devel mailing list