Skip to content

Commit a1f51ec

Browse files
committed
fix: check both systemd error messages for missing boot journal
Support both systemd error message variants for first boot detection: - systemd 255+: 'No journal boot entry found for the specified boot' - systemd 252: 'No such boot ID in journal' Signed-off-by: Sarita Mahajan <sarmahaj@redhat.com> Assisted-by: Claude (claude-sonnet-4.5)
1 parent 163b012 commit a1f51ec

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ fn check_previous_rollback() -> Result<bool> {
179179
if !output.status.success() {
180180
let stderr = String::from_utf8_lossy(&output.stderr);
181181
// Check if failure is due to missing previous boot (expected on first boot)
182-
if stderr.contains("No journal boot entry found for the specified boot") {
182+
// Different systemd versions use different error messages:
183+
// - systemd 255+ (RHEL 10.2): "No journal boot entry found for the specified boot"
184+
// - systemd 252 (RHEL 9.8): "Data from the specified boot (-1) is not available: No such boot ID in journal"
185+
if stderr.contains("No journal boot entry found for the specified boot")
186+
|| stderr.contains("No such boot ID in journal")
187+
{
183188
log::info!(
184189
"No previous boot journal available (expected on first boot or systems with non-persistent journal). Skipping rollback check."
185190
);

0 commit comments

Comments
 (0)