Bug 84867 - journalctl misbehaves with --lines
Summary: journalctl misbehaves with --lines
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium critical
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL: http://files.cockpit-project.org/file...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-10 09:04 UTC by Marius Vollmer
Modified: 2014-12-08 18:25 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Marius Vollmer 2014-10-10 09:04:13 UTC
systemd-215-14.fc21.x86_64

With this set of journal files

    files.cockpit-project.org/files/journal-bug.tar.xz

I can see this behavior:

$ journalctl -D ./journal.bug/ _SYSTEMD_UNIT=accounts-daemon.service | tail -5
Oct 10 09:44:07 f21.cockpit.lan accounts-daemon[1178]: started daemon version 0.6.38
Oct 10 09:57:47 f21.cockpit.lan accounts-daemon[1178]: request by system-bus-name::1.12 [/usr/libexec/cockpitd pid:1169 uid:1000]: delete user 'junior' (1001)
Oct 10 09:57:47 f21.cockpit.lan userdel[4245]: delete user 'junior'
Oct 10 09:57:47 f21.cockpit.lan userdel[4245]: removed group 'junior' owned by 'junior'
Oct 10 09:57:47 f21.cockpit.lan userdel[4245]: removed shadow group 'junior' owned by 'junior'

$ journalctl -D ./journal.bug/ _SYSTEMD_UNIT=accounts-daemon.service --lines=100 | tail -5
Oct 08 10:35:52 f21.cockpit.lan accounts-daemon[1255]: started daemon version 0.6.38
-- Reboot --
Oct 08 14:08:00 f21.cockpit.lan accounts-daemon[1937]: started daemon version 0.6.38
-- Reboot --
Oct 10 09:44:07 f21.cockpit.lan accounts-daemon[1178]: started daemon version 0.6.38

That is, when using --lines, journalctl omits some lines at the end.  Erroneously omitting journal lines is critical, I think.

(The journal files might be corruped since they come from a machine that is being mistreated quite badly, but journalctl doesn't give any sign of that.)
Comment 1 Stef Walter 2014-10-10 09:43:51 UTC
Can reproduce here.
Comment 2 Andrej Manduch 2014-12-06 15:16:08 UTC
fix for this is alredy in mailing list and it's waiting to be merged.

https://www.mail-archive.com/systemd-devel@lists.freedesktop.org/msg25682.html
Comment 3 Marius Vollmer 2014-12-08 07:37:37 UTC
"Although the basic idea of binary search is comparatively straightforward, the details can be surprisingly tricky…" — Donald Knuth.  :-)

Thanks for the fix!
Comment 4 Lennart Poettering 2014-12-08 18:25:25 UTC
Fix applied!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.