cloud-init status --wait returns before cloud-final has finished executing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
High
|
Chad Smith |
Bug Description
I'm instrumenting our EC2 instances to report whether cloud-init succeeded or failed during the boot process. I've implemented this as a systemd unit that is triggered early in the boot process that runs a script that resembles the following:
cloud_init_status=0
cloud-init status --wait || cloud_init_
if [ "$cloud_
report_
else
report_
fi
I was expecting `cloud-init status --wait` to only return after cloud-final has completed, but I discovered today that it can return early if there is an error encountered during the cloud-config stage.
I reported this in IRC and @blackboxsw thought the issue might be somewhere in this code ( https:/
I am using cloud-init 20.2-45 on Xenial.
Changed in cloud-init: | |
assignee: | nobody → Chad Smith (chad.smith) |
Thanks for filing this bug, Jeff! I agree with Chad, this is a bug; the help text for the --wait options reads:
-w, --wait Block waiting on cloud-init to complete
I can't think of cases where someone might be running `cloud-init status --wait` and relying on the current behaviour of exit-early- in-case- of-error, so I think the correct thing to do here is to modify the behaviour of --wait to match its help text.