Automatic rollback trigger criteria on Fedora Atomic variants
0 reputation · 31 May 2026, 13:04 UTC
0 reputation · 31 May 2026, 13:04 UTC
Fedora Atomic variants support automatic rollback on boot failure through systemd-boot or GRUB with boot counting. When configured, a deployment that fails to boot can automatically fall back to the previous deployment without manual intervention.
The current implementation relies solely on boot success to determine deployment validity. This approach does not detect application-level failures, service crashes, or schema-migration issues that manifest after the system has successfully booted. The bootloader cannot distinguish between a system that boots cleanly but fails to operate correctly versus one that boots normally.
rpm-ostree retains only a limited number of deployments (typically current and previous), meaning older states are garbage-collected. This shallow rollback depth combined with uncertain failure detection creates ambiguity about when and how automatic rollback should trigger.
Automatic rollback on Fedora Atomic variants occurs only when the boot process does not reach the systemd success target (multi-user.target or graphical.target). The bootloader treats a kernel panic, initramfs failure, or a boot that hangs before that target as a failure and decrements its per‑entry failure counter. After the configured threshold (default 2 consecutive failures) the bootloader selects the previous deployment.
boot-count.service and boot-success.service for systemd‑boot, or by grub2-boot-success.service and the GRUB blscfg plugin for GRUB2.multi-user.target (or graphical.target for desktop spins) becomes active.Service‑level or application failures that happen after the success target do not increment the failure counter, so they do not trigger automatic rollback. Administrators must add their own health‑check or watchdog to initiate a rollback in those cases.
bootctl status (systemd‑boot) or grub2-editenv list (GRUB2).systemctl status boot-success.service (systemd‑boot) or systemctl status grub2-boot-success.service (GRUB2). Look for 'Active: active (exited)' in the journal.bootctl get-variable LoaderEntryOption-$(sudo blkid -s PARTUUID -o value $(mountpoint /boot))sudo grub2-editenv list and note boot_success and boot_failures variables.systemd.unit=emergency.target to the kernel command line of the newest deployment, reboot twice, and verify that the system boots the previous deployment. Then remove the parameter and confirm normal boot resumes.If you need rollback for failures that appear after the success target, create a custom health‑check unit ordered after your critical services:
[Unit]
Description='Post‑boot deployment health check'
After=multi-user.target myapp.service
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/deployment-healthcheck
OnFailure=rollback-on-failure.service
[Install]
WantedBy=multi-user.target
The rollback-on-failure.service can simply run rpm-ostree rollback followed by systemctl reboot. This extends the success criterion beyond the boot target.
If you are unsure whether your image uses systemd‑boot or GRUB2, run bootctl status; if it reports 'System: Not booted with systemd‑boot', assume GRUB2 and verify with grub2-editenv list. Knowing the bootloader changes which journal units you inspect, but the rollback logic itself is the same.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.