Bug 1275409

Summary: [RFE] cloud-init support package_reboot_if_required
Product: [Fedora] Fedora Reporter: Aleksandar Kostadinov <akostadi>
Component: cloud-initAssignee: Major Hayden 🤠 <mhayden>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: high    
Version: rawhideCC: apevec, gholms, Jan.van.Eldik, mattdm, p, shardy, s
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-21 19:29:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Aleksandar Kostadinov 2015-10-26 20:25:16 UTC
Description of problem:
Cloud-init in deb based distributions have the option `package_reboot_if_required` that would reboot machine if packages were updated mandating a reboot. But this option does not work on RPM based distros.

Even if we have an option to always reboot after upgrade, that would greatly help. Without such option, machine may end up in inconsistent state after a big RPM update. It's hard to implement with script.

Comment 1 Matthew Miller 2015-10-27 13:54:47 UTC
This seems important for Atomic, too, which _always_ requires a reboot.

Comment 2 Garrett Holmstrom 2016-07-07 02:42:57 UTC
Debian packages indicate that a reboot is necessary by creating /var/run/reboot-required.  If cloud-init detects that file after it finishes installing packages it immediately reboots the system.

Fedora doesn't have that file, but one route we could take is to instead run the ``tracer'' command and see if it complains about anything that needs to be restarted.  Some quick testing suggests that its exit code reflects whether a reboot is necessary or not, but I am somewhat hesitant to go that route, lest crashes cause boot loops.

That does bring in a couple more dependencies, but they're relatively lightweight.  Thoughts?

Comment 3 Aleksandar Kostadinov 2016-07-07 12:31:20 UTC
I would appreciate if we can force reboot when we want. And implementation of auto-guess system, not important so much.

Comment 4 Fedora Admin user for bugzilla script actions 2023-04-28 12:11:07 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 5 Major Hayden 🤠 2023-05-15 11:50:33 UTC
Opened an RFE upstream to see if tracer can write the /var/run/reboot-required file:

  https://github.com/FrostyX/tracer/issues/195

Comment 6 Major Hayden 🤠 2023-05-18 12:24:06 UTC
Kudos to the tracer team as they made a PR to get this working in tracer! 🎉

https://github.com/FrostyX/tracer/issues/195#event-9279013791

Comment 7 Major Hayden 🤠 2023-06-28 14:03:32 UTC
PR made to kickstart: https://pagure.io/fedora-kickstarts/pull-request/968

Comment 8 Major Hayden 🤠 2023-08-21 19:29:52 UTC
This is currently in F39/F40 and it works! 🎉