-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix journalctl --follow
with non-matching filter
#257
base: main
Are you sure you want to change the base?
Commits on Aug 5, 2024
-
mount-util: add umount_and_free() helper
(cherry picked from commit a789f72) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 964960b - Browse repository at this point
Copy the full SHA 964960bView commit details -
journalctl: use DEFINE_MAIN_FUNCTION() macro
(cherry picked from commit 9556e79) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 539019e - Browse repository at this point
Copy the full SHA 539019eView commit details -
journalctl: fix output when --lines is used with --grep
Previously, we skip the entries before arg_lines unconditionally, which doesn't behave correctly when used with --grep. After this commit, when a pattern is specified, we don't skip the entries early, but rely on the count of the lines shown to tell us when to stop. To achieve that we would have to search backwards instead. Fixes #25147 (cherry picked from commit db46919) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for f53fa49 - Browse repository at this point
Copy the full SHA f53fa49View commit details -
journalctl: fix output when --until is used with --lines
Before this commit, when --lines is specified, we jump to the tail and search afterwards from there, thus breaking --until if used together. After this commit: If both --until and any of --reverse and --lines is specified, things get a little tricky. We seek to the place of --until first. If only --reverse or --reverse and --lines is specified, we search backwards and let the output counter handle --lines for us. If only --lines is used, we just jump backwards arg_lines and search afterwards from there. (cherry picked from commit 81fb537) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 302992b - Browse repository at this point
Copy the full SHA 302992bView commit details -
journalctl: fix output when --since is used with --lines
Before this commit, if --since is used with --lines=N, we seek to the place of --since and search afterwards there, resulting in outputing the first N lines. After this commit, we only do the above if --since is used without --reverse and --lines. Otherwise we seek to the tail first and check if the entry is within the range of --since later. (cherry picked from commit f582695) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 660fb97 - Browse repository at this point
Copy the full SHA 660fb97View commit details -
journalctl: fix when --since, --until and --lines are used altogether
This is a follow-up for #26669 (81fb537). After the mentioned commit, we stopped checking if the entry is within the range of --until if --lines is used. However, when --since, --until and --lines=N are used altogether, and the number of lines between --since and --until is smaller than N, we would seek to --since later (f582695). This breaks the assumption that if --lines is set, the boundary is never exceeded because the counter of outputs gets us covered. (cherry picked from commit 5d2ab01) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for cdb4104 - Browse repository at this point
Copy the full SHA cdb4104View commit details -
Configuration menu - View commit details
-
Copy full SHA for b834366 - Browse repository at this point
Copy the full SHA b834366View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48f67ed - Browse repository at this point
Copy the full SHA 48f67edView commit details -
test: check if we can use --merge with --follow
Provides coverage for #24565. (cherry picked from commit c11c50a) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 97b5411 - Browse repository at this point
Copy the full SHA 97b5411View commit details -
journalctl: always initialize global variables
That's not necessary, as they are initialized with zero, but for safety and readability. (cherry picked from commit 4f0165f) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 7d95fdd - Browse repository at this point
Copy the full SHA 7d95fddView commit details -
journalctl: use correct variable to check if --since is specified
(cherry picked from commit 20e933a) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 81b27b0 - Browse repository at this point
Copy the full SHA 81b27b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for c15028b - Browse repository at this point
Copy the full SHA c15028bView commit details -
journalctl: split out action_list_fields()
No functional change, just refactoring. (cherry picked from commit 2ce9a07) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 551c56b - Browse repository at this point
Copy the full SHA 551c56bView commit details -
journalctl: split out update_cursor()
No functional change, just refactoring. (cherry picked from commit 8c12d35) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for d606ae5 - Browse repository at this point
Copy the full SHA d606ae5View commit details -
No functional changes, just refactoring. (cherry picked from commit e4c4a9d) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 1230414 - Browse repository at this point
Copy the full SHA 1230414View commit details -
journalctl: replace ppoll() loop with sd_event_loop()
No functional change, just refactoring. (cherry picked from commit 713342d) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for a4db3a3 - Browse repository at this point
Copy the full SHA a4db3a3View commit details -
journalctl: also update cursor with --follow
Fixes #26746. (cherry picked from commit 24d633e) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 01bc275 - Browse repository at this point
Copy the full SHA 01bc275View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53d98ca - Browse repository at this point
Copy the full SHA 53d98caView commit details -
journalctl: fix --follow with non-matching filter
When there is no matching entry stored in journal, then initial call of `sd_journal_previous()` following `sd_journal_seek_tail()` returns zero, and does not move the read pointer. In the main loop, on every journal event, we call `sd_journal_next()`, even though the current location is tail, and it takes no effect. In such a case, we need to call `sd_journal_previous()` instead of `sd_journal_next()`. (cherry picked from commit 80ec3db) Resolves: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 8501075 - Browse repository at this point
Copy the full SHA 8501075View commit details -
Configuration menu - View commit details
-
Copy full SHA for d4363bc - Browse repository at this point
Copy the full SHA d4363bcView commit details -
journalctl: do not add io event source for stdout if it is a file
Fixes a bug introduced by 713342d. Fixes #28636. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2228089. (cherry picked from commit f882a98) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 430fa10 - Browse repository at this point
Copy the full SHA 430fa10View commit details -
journalctl: support --lines=+N for showing the oldest N entries
After f582695, the wrong behavior occurred when --since= and --lines= are both specified is fixed. However, it seems that the old behavior is already being somewhat widely used, and the function itself makes sense, i.e. to allow --lines= to output the first N journal entries. Therefore, let's support prefixing the number for --lines= with '+', and provide such functionality. Related: #28746 (cherry picked from commit 8d6791d) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 1d9008d - Browse repository at this point
Copy the full SHA 1d9008dView commit details -
journalctl: don't skip over messages not matching the cursor
When --after-cursor=/--cursor-file= is used together with a journal filter, we still skipped over the first matching entry even if it wasn't the entry the cursor points at, thus missing one "valid" entry completely. Let's fix this by checking if the entry cursor after seeking matches the user provided cursor, and skip to the next entry only when the cursors match. Resolves: #30288 (cherry picked from commit 4207a55) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for ca0a656 - Browse repository at this point
Copy the full SHA ca0a656View commit details -
journalctl: make --until work again with --after-cursor and --lines
Fixes a regression introduced by 81fb537. If one of the cursor option is specified, we first seek to the cursor position. So, the current position may be out of the time range specified by --until, and we need to verify the timestamp of the current position. Fixes #31776. Co-authored-by: Reid Wahl <nrwahl@protonmail.com> (cherry picked from commit cb2be36) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 8160d9f - Browse repository at this point
Copy the full SHA 8160d9fView commit details -
test: add test case for issue #31776
(cherry picked from commit bf99542) Related: RHEL-30567
Configuration menu - View commit details
-
Copy full SHA for 614ea41 - Browse repository at this point
Copy the full SHA 614ea41View commit details