File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,19 @@ get_last_timestamp() {
2424
2525# There may be huge amount of pending messages in sockets. Processing them may cause journal rotation.
2626# If the journal is rotated in the loop below, some journal file may not be loaded and an unexpected
27- # result may be provided. To mitigate such, sync before reading journals. Workaround for #32890.
27+ # result may be provided. To mitigate such, flush (if not yet) and sync before reading journals.
28+ # Workaround for #32890.
29+ journalctl --flush
2830journalctl --sync
31+ # Sometimes, loading partially written .journal file, and journalctl handled that as 'truncated':
32+ # ===
33+ # May 21 02:25:55 TEST-09-REBOOT.sh[433]: + journalctl --list-boots -o json
34+ # May 21 02:25:55 journalctl[433]: Journal file /var/log/journal/173da2fad3064e3e9211a7ed7d59360b/system.journal is truncated, ignoring file.
35+ # ===
36+ # If that happens, the entries stored in the journal file are ignored, and the results of --list-boots
37+ # and subsequent call of journalctl may become inconsistent. To prevent such issue, let's also rotate
38+ # the journal. Then, all journal entries we are interested in are stored in the archived journal files.
39+ journalctl --rotate
2940
3041# Issue: #29275, second part
3142# Now let's check if the boot entries are in the correct/expected order
You can’t perform that action at this time.
0 commit comments