File: wait_for_cloud_init.rst

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (33 lines) | stat: -rw-r--r-- 738 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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-init.target multi-user.target

    [Service]
    Type=oneshot
    ExecStart=sh -c 'echo "Howdy partner 🤠"'

    [Install]
    WantedBy=multi-user.target