From e5e31407d9a9aace1496b60508cfbdf10cea2040 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Wed, 9 Jul 2025 16:59:17 -0600 Subject: [PATCH 1/2] doc: Document changed systemd order in 24.4 --- doc/rtd/reference/breaking_changes.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/rtd/reference/breaking_changes.rst b/doc/rtd/reference/breaking_changes.rst index 7f85c9df32b..e7db3b9e9dc 100644 --- a/doc/rtd/reference/breaking_changes.rst +++ b/doc/rtd/reference/breaking_changes.rst @@ -70,7 +70,15 @@ anything that was installed to ``/lib`` is now installed to ``/usr/lib``. This shouldn't affect any systemd-based distributions as they have all transitioned to the ``/usr`` merge. However, this could affect older stable releases, non-systemd and non-Linux distributions. See -`this commit `_ +`commit 054734921 `_ +for more details. + +24.4 +==== + +Cloud-init's `cloud-final.service` order was standardized. This caused a +change to the systemd boot order on some distributions. See +`commit 245f94674 `_ for more details. 24.3 From 1878b1958d0d3bf6246ddbedaf1bc3b9882516a2 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Wed, 9 Jul 2025 17:19:43 -0600 Subject: [PATCH 2/2] doc: Document how to wait for cloud-init --- doc/rtd/howto/index.rst | 1 + doc/rtd/howto/wait_for_cloud_init.rst | 33 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 doc/rtd/howto/wait_for_cloud_init.rst diff --git a/doc/rtd/howto/index.rst b/doc/rtd/howto/index.rst index d3bc25524bf..d03e3909f66 100644 --- a/doc/rtd/howto/index.rst +++ b/doc/rtd/howto/index.rst @@ -19,6 +19,7 @@ How do I...? :maxdepth: 1 Launch cloud-init with... + Wait for cloud-init Re-run cloud-init Change how often a module runs Validate my user-data diff --git a/doc/rtd/howto/wait_for_cloud_init.rst b/doc/rtd/howto/wait_for_cloud_init.rst new file mode 100644 index 00000000000..929ab138593 --- /dev/null +++ b/doc/rtd/howto/wait_for_cloud_init.rst @@ -0,0 +1,33 @@ +.. _wait_for_cloud_init: + +How to wait for cloud-init +************************** + +It is useful to be able to wait until cloud-init has completed running prior +to doing some other task. + +CLI +=== + +Cloud-init's command ``cloud-init status --wait`` will exit once cloud-init has +completed. + +SystemD +======= + +Systems using systemd may be configured to start a service after cloud-init +completes. This may be accomplished by including +``After=cloud-init.target multi-user.target`` in the unit file. For example: + +.. code-block:: + + [Unit] + Description=Example service + After=cloud-final.service multi-user.target + + [Service] + Type=oneshot + ExecStart=sh -c 'echo "Howdy partner 🤠"' + + [Install] + WantedBy=multi-user.target