<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - journalctl --directory doesn't follow rotated files properly"
href="https://bugs.freedesktop.org/show_bug.cgi?id=90193#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - journalctl --directory doesn't follow rotated files properly"
href="https://bugs.freedesktop.org/show_bug.cgi?id=90193">bug 90193</a>
from <span class="vcard"><a class="email" href="mailto:sebastian.schindler+bugzilla@travelping.com" title="Sebastian Schindler <sebastian.schindler+bugzilla@travelping.com>"> <span class="fn">Sebastian Schindler</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=115371" name="attach_115371" title="short example to reproduce the error">attachment 115371</a> <a href="attachment.cgi?id=115371&action=edit" title="short example to reproduce the error">[details]</a></span>
short example to reproduce the error
To create an example that triggers the rotation which leads to the bug I did
the following steps:
-log something:
$logger a
$logger b
-save the coresponding journalentries:
$journalctl -n2 -o export >> entries.txt
-switch the timestamps and cursors of the entries (result named
switched_entries.txt, see attachment)
-this will cause the journalfile to be rotated after the first entry "a" is
written
-now follow a directory with journalctl
$journalctl --directory logtest/ -f
-create a new logfile with this entries:
$cat switched_entries.txt | systemd-journal-remote -o ~/logtest/a.journal -
-OUTPUT of journalctl:
No journal files were found.
Apr 27 10:07:40 virtual-fedora-sbs tpiadmin[9617]: a
-some new logging into the file:
$logger c
$journalctl -o export -n 1 | systemd-journal-remote -o ~/logtest/a.journal -
-leads to no new output, however:
-some logging into a new file in the same directory
$logger a2
$journalctl -o export -n 1 | systemd-journal-remote -o ~/logtest/b.journal -
-OUTPUT:
No journal files were found.
Apr 27 10:07:40 virtual-fedora-sbs tpiadmin[9617]: a
Apr 27 14:39:57 virtual-fedora-sbs tpiadmin[11424]: a2
//only the last line is actually new
-this new file will be followed until it gets rotated
-this problem also occurs, if the file gets rotated for other reasons than this
"errors", for example if simply a rotation due to size happens
-some weird interaction I noticed: If the logs are put into the journal file
two times:
$ journalctl -o export -n 1 | systemd-journal-remote -o ~/logtest/b.journal -
$ journalctl -o export -n 1 | systemd-journal-remote -o ~/logtest/b.journal -
-then the output of this doubled input is shown once, however the file isn't
properly followed after that (new entries won't show up)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>