Red Hat Bugzilla – Bug 1275409
[RFE] cloud-init support package_reboot_if_required
Last modified: 2016-07-07 08:31:20 EDT
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.
This seems important for Atomic, too, which _always_ requires a reboot.
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?
I would appreciate if we can force reboot when we want. And implementation of auto-guess system, not important so much.