| 1 | [Unit] |
| 2 | # https://docs.cloud-init.io/en/latest/explanation/boot.html |
| 3 | Description=Cloud-init: Config Stage |
| 4 | After=network-online.target cloud-config.target |
| 5 | Wants=network-online.target cloud-config.target |
| 6 | ConditionPathExists=!/etc/cloud/cloud-init.disabled |
| 7 | ConditionKernelCommandLine=!cloud-init=disabled |
| 8 | ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled |
| 9 | |
| 10 | [Service] |
| 11 | Type=oneshot |
| 12 | # This service is a shim which preserves systemd ordering while allowing a |
| 13 | # single Python process to run cloud-init's logic. This works by communicating |
| 14 | # with the cloud-init process over a unix socket to tell the process that this |
| 15 | # stage can start, and then wait on a return socket until the cloud-init |
| 16 | # process has completed this stage. The output from the return socket is piped |
| 17 | # into a shell so that the process can send a completion message (defaults to |
| 18 | # "done", otherwise includes an error message) and an exit code to systemd. |
| 19 | ExecStart=sh -c 'echo "start" | nc -U /run/cloud-init/share/config.sock | sh' |
| 20 | RemainAfterExit=yes |
| 21 | TimeoutSec=0 |
| 22 | |
| 23 | # Output needs to appear in instance console output |
| 24 | StandardOutput=journal+console |
| 25 | |
| 26 | [Install] |
| 27 | WantedBy=cloud-init.target |