Skip to content

generate: order service After=systemd-sysusers.service#573

Open
guilherme-puida wants to merge 1 commit intocanonical:mainfrom
guilherme-puida:push-rrnytvttwooy
Open

generate: order service After=systemd-sysusers.service#573
guilherme-puida wants to merge 1 commit intocanonical:mainfrom
guilherme-puida:push-rrnytvttwooy

Conversation

@guilherme-puida
Copy link
Copy Markdown

Description

netplan-configure.service needs to resolve the "systemd-network" GID. To do that, is ordered After=nss-user-lookup.target. However, if this target is After= another service that is itself
After=network-online.target (for example, winbind.service), this causes an ordering cycle.

Mar 23 18:02:51 netplan-winbind systemd[1]: network.target: Found ordering cycle: winbind.service/stop after nss-user-lookup.target/stop after netplan-configure.service/stop after network-pre.target/stop after network.target/stop - after winbind.service
Mar 23 18:02:51 netplan-winbind systemd[1]: network.target: Job winbind.service/stop deleted to break ordering cycle starting with network.target/stop

Since "systemd-network" is created early by systemd-sysusers, we can order the service After=systemd-sysusers.service to ensure that the group already exists without triggering network-related cycles.

Related: https://code.launchpad.net/~puida/ubuntu/+source/netplan.io/+git/netplan.io/+merge/502503 and https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2071747 (comment #5 onwards)

Checklist

  • Runs make check successfully.
  • Retains code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad.

netplan-configure.service needs to resolve the "systemd-network" GID. To
do that, is ordered After=nss-user-lookup.target. However, if this
target is After= another service that is itself
After=network-online.target (for example, winbind.service), this causes
an ordering cycle.

Mar 23 18:02:51 netplan-winbind systemd[1]: network.target: Found
ordering cycle: winbind.service/stop after nss-user-lookup.target/stop
after netplan-configure.service/stop after network-pre.target/stop after
network.target/stop - after winbind.service
Mar 23 18:02:51 netplan-winbind systemd[1]: network.target: Job
winbind.service/stop deleted to break ordering cycle starting with
network.target/stop

Since "systemd-network" is created early by systemd-sysusers, we can
order the service After=systemd-sysusers.service to ensure that the
group already exists without triggering network-related cycles.
@benhoyt benhoyt added the needs review soon A PR marked as needing review soon, for some value of "soon". label Mar 24, 2026
@guilherme-puida
Copy link
Copy Markdown
Author

FYI: This was uploaded to Ubuntu as 1.2-1ubuntu4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review soon A PR marked as needing review soon, for some value of "soon".

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants