Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wait for cloud-init.service to fully activate #3021

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

catmsred
Copy link
Collaborator

@catmsred catmsred commented Mar 27, 2024

Once the systemd constraint on After cloud-config.service was removed, there are situations where cloud-config.service runs so long after pro that the python code that waits for cloud-config.service to finish activating is being bypassed as if cloud-init isn't on the system. This change forces pro to wait for cloud-config to finish if cloud-init is running at all.

Fixes #3000

Please Squash this PR with this commit message

fix: wait for cloud-init.service to fully activate

Once the systemd constraint on After cloud-config.service was
removed, there are situations where cloud-config.service runs so
long after pro that the python code that waits for
cloud-config.service to finish activating is being bypassed as if
cloud-init isn't on the system.  This change forces pro to wait
for cloud-config to finish if cloud-init is running at all.

Fixes: #3000 
LP: #2059952

Checklist

  • I have updated or added any unit tests accordingly
  • I have updated or added any integration tests accordingly
  • Changes here need to be documented, and this was done in:

Does this PR require extra reviews?

  • Yes
  • No

Once the systemd constraint on After cloud-config.service was
removed, there are situations where cloud-config.service runs so
long after pro that the python code that waits for
cloud-config.service to finish activating is being bypassed as if
cloud-init isn't on the system.  This change forces pro to wait
for cloud-config to finish if cloud-init is running at all.
Copy link

Jira: This PR is not related to a Jira item. (The PR title does not include a SC-#### reference)

GitHub Issues: No GitHub issues are fixed by this PR. (No commits have Fixes: #### references)

Launchpad Bugs: No Launchpad bugs are fixed by this PR. (No commits have LP: #### references)

Documentation: The changes in this PR do not require documentation changes.

👍 this comment to confirm that this is correct.

@catmsred
Copy link
Collaborator Author

Verified that it fixed the issue in GCP using a custom image with this branch's pro on it:

$ gcloud compute instances create pro-order-bug-custompro --image testing-ubuntu-pro-2204-jammy-v20240328 --image-project ubuntu-catred --metadata-from-file=user-data=userdata.yaml

catred@pro-order-bug-custompro:~$ pro status
SERVICE          ENTITLED  STATUS       DESCRIPTION
anbox-cloud      yes       disabled     Scalable Android in the cloud
esm-apps         yes       disabled     Expanded Security Maintenance for Applications
esm-infra        yes       disabled     Expanded Security Maintenance for Infrastructure
fips-preview     yes       disabled     Preview of FIPS crypto packages undergoing certification with NIST
usg              yes       disabled     Security compliance and audit tools

For a list of all Ubuntu Pro services, run 'pro status --all'
Enable services with: pro enable <service>

                Account: ubuntu-catred
           Subscription: ubuntu-catred
            Valid until: Fri Dec 31 00:00:00 9999 UTC
Technical support level: essential
catred@pro-order-bug-custompro:~$ cat /var/log/cloud-init.log | grep 'WARNING'
catred@pro-order-bug-custompro:~$ 

Copy link
Member

@renanrodrigo renanrodrigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this one!
LGTM

@catmsred catmsred merged commit 3ee749d into main Apr 1, 2024
35 of 38 checks passed
@renanrodrigo renanrodrigo deleted the fix/wait_on_cloud-init branch April 1, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: pro sometimes runs before cloud-config.service
3 participants