[systemd-devel] odd seek_tail behaviour

Christian Hesse list at eworm.de
Mon Oct 13 11:22:37 PDT 2014


Daurnimator <quae at daurnimator.com> on Mon, 2014/10/13 01:27:
> Hi All,
> 
> I was trying to write a program that tailed the journal, but found that
> sd_journal_seek_tail() didn't work as expected.
> That is: that it would seek to the last/most recent thing in the journal,
> and I could tail things from there.
> 
> I whipped up a quick demonstration program, that shows that messages I
> 'next' through, are before the 'cutoff':
> 
> [code and output]
> 
> Is this behaviour expected? I'm using systemd 216.

I do see a similar problem in my code [0]. I do call sd_journal_previous()
after sd_journal_seek_tail(), but I still do see some older message come up.

sd_journal_next() is the first I call in while loop. Perhaps even this is a
problem?

[0] https://github.com/eworm-de/journal-notify/blob/master/journal-notify.c

-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20141013/4b803d8b/attachment.sig>


More information about the systemd-devel mailing list