From 2f4e974d8aeb7110117b52c87ec6b28d58bacd38 Mon Sep 17 00:00:00 2001 From: Daniel Casota Date: Thu, 10 Sep 2026 16:22:33 +0200 Subject: [PATCH] cloud-init: fix the generator looking for ds-identify at the wrong path On Photon OS 5.0 subrelease 92, cloud-init does not run at boot. The systemd generator terminates with exit status 3, no datasource is identified, and the six cloud-* units remain inactive although they are enabled. No unit enters a failed state, so systemctl --failed reports no error. Sep 09 21:20:46 (sd-exec-[614]: /usr/lib/systemd/system-generators/ cloud-init-generator failed with exit status 3. Instance configuration normally applied by cloud-init - SSH key injection, hostname assignment, user-data processing and network configuration - is therefore not applied. Two path mismatches are responsible, both introduced when the package moved to a meson build. 1. systemd/cloud-init-generator.tmpl resolves ds-identify from a path selected by build variant. photon is not a member of the list that selects libexecdir, so the template renders the else branch: {% if variant in ["almalinux", ..., "rhel", "rocky", ...] %} dsidentify="/usr/libexec/cloud-init/ds-identify" {% else %} dsidentify="/usr/lib/cloud-init/ds-identify" while %{meson_install} places the binary in /usr/libexec/cloud-init. Rendering the template confirms the branch selection: --variant photon -> /usr/lib/cloud-init/ds-identify --variant rhel -> /usr/libexec/cloud-init/ds-identify 2. cloudinit/distros/photon.py does not override Distro.usr_lib_exec, which defaults to /usr/lib in cloudinit/distros/__init__.py:132. rhel.py:30 sets /usr/libexec. The attribute is read by cc_keys_to_console.py:36 and distros/__init__.py:1406, so both resolve to /usr/lib/cloud-init while the package installs write-ssh-key-fingerprints and hook-hotplug under /usr/libexec/cloud-init. Both patches align cloud-init's expectations with the location the package already installs to. Photon OS is an RPM distribution whose meson build installs helpers to libexecdir, consistent with the variants already listed. Introduced by cd1c1fff9 (25.1.3-11 -> 26.2-1), which changed %py3_install to %{meson_install} and relocated the payload from %{_libdir}/%{name} to %{_libexecdir}/%{name}. The %files section was updated accordingly; the generator template and photon.py were not. 25.1.3-11 was internally consistent: it installed ds-identify under /usr/lib/cloud-init and the generator resolved the same path. The currently published 26.2-2 is affected. Its changelog entry covers the python3-configobj dependency and modifies neither path. Affected releases: Photon OS 5.0 subrelease 92 only. cloud-init.spec carries %global build_if %{photon_subrelease} >= 92, and SPECS/91 (25.1.3-11.1), SPECS/90 (25.1.3-4.1.1), 4.0 (25.1.3-3) and dev (24.4-1) remain on releases that install helpers under %{_libdir}, where the generator's expected path is correct. This change raises the mainline package to 26.2-3. Runtime evidence from four guest installations produced by the same automated harness, differing only in the cloud-init version on the installation media: 25.1.3-11 reports "done" on both, 26.2-1 and 26.2-2 report "not started" on both. Change-Id: Icd2715fd307cd045865a081e1ef20298d878b3a7 Signed-off-by: Daniel Casota --- ...011-generator-photon-uses-libexecdir.patch | 55 +++++++++++++++++++ ...12-photon-usr-lib-exec-is-libexecdir.patch | 39 +++++++++++++ SPECS/cloud-init/cloud-init.spec | 6 +- 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 SPECS/cloud-init/0011-generator-photon-uses-libexecdir.patch create mode 100644 SPECS/cloud-init/0012-photon-usr-lib-exec-is-libexecdir.patch diff --git a/SPECS/cloud-init/0011-generator-photon-uses-libexecdir.patch b/SPECS/cloud-init/0011-generator-photon-uses-libexecdir.patch new file mode 100644 index 0000000000..47fc3535bd --- /dev/null +++ b/SPECS/cloud-init/0011-generator-photon-uses-libexecdir.patch @@ -0,0 +1,55 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Casota +Date: Thu, 10 Sep 2026 00:00:00 +0000 +Subject: [PATCH] generator: photon installs ds-identify under libexecdir + +The systemd generator template picks the ds-identify path from the build +variant. Photon is absent from the list of variants that use libexecdir, so +it falls through to the else branch and renders + + dsidentify="/usr/lib/cloud-init/ds-identify" + +while the meson install puts the binary at + + /usr/libexec/cloud-init/ds-identify + +The generator then exits 3, no datasource is ever identified, and all six +cloud-* units stay inactive despite being enabled. Nothing appears in +`systemctl --failed`, so instance configuration - injected SSH keys, +hostname, user-data, network config - is silently not applied. + +Photon is an RPM distribution whose meson build installs helpers to +libexecdir, exactly like the variants already listed, so it belongs in that +branch. + +Rendering the template confirms the change is scoped to photon: + + before --variant photon -> /usr/lib/cloud-init/ds-identify + after --variant photon -> /usr/libexec/cloud-init/ds-identify + --variant rhel -> /usr/libexec/cloud-init/ds-identify (unchanged) + --variant ubuntu -> /usr/lib/cloud-init/ds-identify (unchanged) + +Introduced by the 25.1.3 -> 26.2 upgrade, which moved the install from +%py3_install to %{meson_install} and relocated the payload to libexecdir. +The %files section was updated to match; the generator was not. + +Signed-off-by: Daniel Casota +--- + systemd/cloud-init-generator.tmpl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/systemd/cloud-init-generator.tmpl b/systemd/cloud-init-generator.tmpl +index 888bad5..312a690 100644 +--- a/systemd/cloud-init-generator.tmpl ++++ b/systemd/cloud-init-generator.tmpl +@@ -21,7 +21,7 @@ CLOUD_SYSTEM_TARGET="/usr/lib/systemd/system/cloud-init.target" + CLOUD_SYSTEM_TARGET="/lib/systemd/system/cloud-init.target" + {% endif %} + {% if variant in ["almalinux", "azurelinux", "centos", "cloudlinux", "eurolinux", "fedora", +- "miraclelinux", "openeuler", "OpenCloudOS", "openmandriva", "rhel", "rocky", "TencentOS", "virtuozzo"] %} ++ "miraclelinux", "openeuler", "OpenCloudOS", "openmandriva", "photon", "rhel", "rocky", "TencentOS", "virtuozzo"] %} + dsidentify="/usr/libexec/cloud-init/ds-identify" + {% elif variant == "benchmark" %} + dsidentify="/bin/true" +-- +2.51.0 diff --git a/SPECS/cloud-init/0012-photon-usr-lib-exec-is-libexecdir.patch b/SPECS/cloud-init/0012-photon-usr-lib-exec-is-libexecdir.patch new file mode 100644 index 0000000000..d2ad7a7e1a --- /dev/null +++ b/SPECS/cloud-init/0012-photon-usr-lib-exec-is-libexecdir.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Casota +Date: Thu, 10 Sep 2026 00:00:00 +0000 +Subject: [PATCH] photon: usr_lib_exec is /usr/libexec, as for the other RPM + distros + +Distro.usr_lib_exec defaults to /usr/lib in cloudinit/distros/__init__.py, +and photon.py does not override it - while rhel.py:30 sets /usr/libexec. + +The meson install puts the helpers in libexecdir: + + /usr/libexec/cloud-init/write-ssh-key-fingerprints + /usr/libexec/cloud-init/hook-hotplug + +so cc_keys_to_console looks for write-ssh-key-fingerprints under +/usr/lib/cloud-init and does not find it. Distro.get_clouddir() derives +from the same attribute. + +This is the same libexecdir-vs-lib mismatch the generator template has, +expressed in Python rather than in a rendered shell script. Upstream issue +6588 describes the class of bug. + +Signed-off-by: Daniel Casota +--- + cloudinit/distros/photon.py | 1 + + 1 file changed, 1 insertion(+) + +--- a/cloudinit/distros/photon.py ++++ b/cloudinit/distros/photon.py +@@ -17,6 +17,7 @@ + network_conf_dir = "/etc/systemd/network/" + systemd_locale_conf_fn = "/etc/locale.conf" + resolve_conf_fn = "/etc/systemd/resolved.conf" ++ usr_lib_exec = "/usr/libexec" + + renderer_configs = { + "networkd": { +-- +2.51.0 diff --git a/SPECS/cloud-init/cloud-init.spec b/SPECS/cloud-init/cloud-init.spec index 2022835ef1..f08cf03d7b 100644 --- a/SPECS/cloud-init/cloud-init.spec +++ b/SPECS/cloud-init/cloud-init.spec @@ -9,7 +9,7 @@ Name: cloud-init Version: 26.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Cloud instance init scripts Group: System Environment/Base URL: http://launchpad.net/cloud-init @@ -36,6 +36,8 @@ Patch6: 0007-cli-retain-file-argument-as-main-cmd-arg.patch Patch7: 0008-No-single-process.patch Patch8: 0009-Show-stdout-logs-in-journal-only.patch Patch9: 0010-Drop-mandatory-configobj-dependency.patch +Patch10: 0011-generator-photon-uses-libexecdir.patch +Patch11: 0012-photon-usr-lib-exec-is-libexecdir.patch BuildRequires: meson BuildRequires: bash-completion-devel @@ -165,6 +167,8 @@ rm -rf %{buildroot} %{_mandir}/man1/* %changelog +* Wed Sep 23 2026 Daniel Casota 26.2-4 +- Look up ds-identify and helper scripts under /usr/libexec * Tue Sep 22 2026 Prashant S Chauhan 26.2-3 - Remove stale python3-six dependency * Tue Sep 01 2026 Prashant S Chauhan 26.2-2