cloud-init/cloud-init-pckg-reboot.patch
Robert Schweikert ae07dd3a29 - Support python 3.13:
+ pep-594-drop-pipes.patch, gh#canonical/cloud-init#4392
  + cloud-init-fix-python313.patch, gh#canonical/cloud-init#4669
  + cloud-init-dont-assume-ordering-of-ThreadPoolExecutor.patch gh#canonical/cloud-init#5052

OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=241
2025-01-21 21:05:02 +00:00

29 lines
1.2 KiB
Diff

--- cloudinit/config/cc_package_update_upgrade_install.py.orig
+++ cloudinit/config/cc_package_update_upgrade_install.py
@@ -18,7 +18,7 @@ from cloudinit.config.schema import Meta
from cloudinit.distros import ALL_DISTROS
from cloudinit.settings import PER_INSTANCE
-REBOOT_FILE = "/var/run/reboot-required"
+REBOOT_FILES = ("/var/run/reboot-required", "/run/reboot-needed")
REBOOT_CMD = ["/sbin/reboot"]
MODULE_DESCRIPTION = """\
@@ -120,11 +120,14 @@ def handle(name: str, cfg: Config, cloud
# kernel and openssl (possibly some other packages)
# write a file /var/run/reboot-required after upgrading.
# if that file exists and configured, then just stop right now and reboot
- reboot_fn_exists = os.path.isfile(REBOOT_FILE)
+ for reboot_marker in REBOOT_FILES:
+ reboot_fn_exists = os.path.isfile(reboot_marker)
+ if reboot_fn_exists:
+ break
if (upgrade or pkglist) and reboot_if_required and reboot_fn_exists:
try:
LOG.warning(
- "Rebooting after upgrade or install per %s", REBOOT_FILE
+ "Rebooting after upgrade or install per %s", reboot_marker
)
# Flush the above warning + anything else out...
logging.flushLoggers(LOG)