SHA256
1
0
forked from pool/cloud-init

- Add cloud-init-pckg-reboot.patch (boo#1198533, bsc#1218952)

+ Support reboot on package update/upgrade via the cloud-init config

OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=221
This commit is contained in:
Robert Schweikert 2024-01-19 19:21:21 +00:00 committed by Git OBS Bridge
parent b6c114b78d
commit 204408f666
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,28 @@
--- 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)

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jan 19 19:19:49 UTC 2024 - Robert Schweikert <rjschwei@suse.com>
- Add cloud-init-pckg-reboot.patch (boo#1198533, bsc#1218952)
+ Support reboot on package update/upgrade via the cloud-init config
-------------------------------------------------------------------
Fri Dec 15 14:09:36 UTC 2023 - Robert Schweikert <rjschwei@suse.com>

View File

@ -39,6 +39,8 @@ Patch6: cloud-init-write-routes.patch
# FIXME (https://github.com/canonical/cloud-init/issues/4339)
Patch7: cloud-init-keep-flake.patch
Patch8: cloud-init-lint-fixes.patch
# FIXME (https://github.com/canonical/cloud-init/pull/4788)
Patch9: cloud-init-pckg-reboot.patch
BuildRequires: fdupes
BuildRequires: filesystem
# pkg-config is needed to find correct systemd unit dir
@ -145,6 +147,7 @@ Documentation and examples for cloud-init tools
%patch6
%patch7
%patch8
%patch9
# patch in the full version to version.py
version_pys=$(find . -name version.py -type f)