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

cyclic dependencies, cloud-init.target has After=mutli-user.target #4068

Closed
ubuntu-server-builder opened this issue May 12, 2023 · 2 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #2003877

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = 2023-01-27T14:58:00.411468+00:00
date_created = 2023-01-25T15:29:45.975925+00:00
date_fix_committed = None
date_fix_released = None
id = 2003877
importance = undecided
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/2003877
milestone = None
owner = izzette
owner_name = Isabelle COWAN-BERGMAN
private = False
status = invalid
submitter = izzette
submitter_name = Isabelle COWAN-BERGMAN
tags = []
duplicates = []

Launchpad user Isabelle COWAN-BERGMAN(izzette) wrote on 2023-01-25T15:29:45.975925+00:00

cloud-init.target is ordered after mutli-user.target as it contains the After=mutli-user.target directive. Advice is given in

# system configuration tasks have completed. To order a service after cloud-init
# is done, add the directives as applicable:
# After=cloud-init.target and Wants=cloud-init.target
:

system configuration tasks have completed. To order a service after cloud-init

is done, add the directives as applicable:

After=cloud-init.target and Wants=cloud-init.target

Following this advice will result in cyclic dependencies in systemd resolution if these directives are added to a unit which is WantedBy=multi-user.target. This is because the unit depending on and scheduled after cloud-init.target is WantedBy mutli-user.target as well which is itself ordered Before cloud-init.target. As adding new units to mutli-user.target is standard practice, this is likely to occur frequently. Related issues have been mentioned before in cloud-init bugs, for example: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1629797/comments/11; as well as other bug trackers: https://bugzilla.redhat.com/show_bug.cgi?id=1393094.

This could be resolved by either of the two:

  • removing the advice that results in cyclic dependencies
  • cloud-init.target depends on basic.target

Additional information

Cloud provider: any

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Isabelle COWAN-BERGMAN(izzette) wrote on 2023-01-25T15:29:45.975925+00:00

Launchpad attachments: ubuntu-bug cloud-init

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user James Falcon(falcojr) wrote on 2023-01-27T14:57:55.729923+00:00

That's why the statement contains the phrase "as applicable". If you have a unit that is "WantedBy=multi-user.target" then by definition, you don't want it running after cloud-init.target, so this advice isn't applicable to your use case. The advice is provided to inform a user how to order something after cloud-init has run, not how avoid all cyclic dependencies. Based on this, I'm going to set this to "Invalid", but if there's a deeper issue here that I'm not understanding, please do comment and set the status back to "New".

@ubuntu-server-builder ubuntu-server-builder closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant