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

wip: Fix cloudinit systemd deadlock #2927

Closed
wants to merge 13 commits into from

Conversation

orndorffgrant
Copy link
Collaborator

@orndorffgrant orndorffgrant commented Jan 26, 2024

currently based on #2887 so only look at the last commit(s?)

ppa:orndorffgrant/proclient-cloudinit-deadlock-test

LP: #2050022

Why is this needed?

This PR solves all of our problems because...

Test Steps

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

orndorffgrant and others added 11 commits January 19, 2024 16:55
We're renaming the following packages using transitional packages to
align the package names with the product naming:

 * ubuntu-advantage-tools -> ubuntu-pro-client
 * ubuntu-advantage-pro -> ubuntu-pro-image-auto-attach

Because old versions of ubuntu-advantage-tools will break ESM upon
removal, and ubuntu-pro-client "Breaks" ubuntu-advantage-tools <<31~,
we need to force existing instances to upgrade to ubuntu-advantage-tools
31 (the transitional package) in order to install the new
ubuntu-pro-client package.

Enforcing that is accomplished via a Depends: ubuntu-advantage-tools on
existing Ubuntu releases. Future Ubuntu releases (Noble onward) will not have
this Depends.

Because of that, all previous package migrations (from versions
older than 31) are left in ubuntu-advantage-tools.{preinst,postinst,postrm}.
All future package migrations will happen in ubuntu-pro-client.{preinst,postinst,postrm}.
By removing "Provides: ubuntu-advantage-tools", we lower the chances of
ubuntu-advantage-tools <31 being removed during an install of
ubuntu-pro-client, becuase ubuntu-minimal (and ubuntu-cloud-minimal)
Depend on ubuntu-advantage-tools. This removes the need for
ubuntu-pro-client Depends: ubuntu-advantage-tools.
Add integration test that install the ubuntu-advantage-tools
transition package and checks that it also install the
new ubuntu-pro-client package.

We are also performing the same check for the ubuntu-advantage-pro
package
Copy link

🌎 This PR changes translatable messages. 🌏

Please select which scenarios apply. For further explanation, please read our policy on message changes.

  • New messages are being added.
    • We will ask translators to take a look and add translations if they have time, but it will not block this PR.
  • Existing messages are being changed.
    • ⚠️ Please add a comment with justification of why messages are being altered.
    • If the changes are trivial (e.g. a typo fix), then translations must be preserved.
    • If the changes are substantial, then we will ask translators to take a look and update translations if they have time, but it will not block this PR.
  • Existing messages are being deleted.
    • No special action needed.

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.

ubuntu-advantage.service is "After: cloud-config.service".
--no-block ensures that it doesn't cause deadlock when cloud-init tries
to install ubuntu-advantage-tools.

This is accomplished by no longer using dh_systemd_start, but taking the
snippets it used to add to maintscripts and hardcoding them. Then I
added --no-block to the "start" command.

I took the latest version of the dh_systemd_start snippets for prerm,
postrm, and postinst. Those snippets are slightly different from those
automatically added on older releases, namely xenial and bionic. The
primary differences are: (1) the addition of checks to only run the snippets
on appropriate dpkg operations by checking $1, and (2) checking that
DPKG_ROOT is empty in addition to the presence of /run/systemd/system
before running systemctl commands.
@orndorffgrant
Copy link
Collaborator Author

closing in favor of #2937

@orndorffgrant orndorffgrant deleted the fix-cloudinit-systemd-deadlock branch February 15, 2024 14:29
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.

2 participants