Skip to content

systemd: replace TimeoutSec=0 with TimeoutSec=300 in network stage - #7055

Closed
sundeep8967 wants to merge 2 commits into
canonical:mainfrom
sundeep8967:fix/cloud-init-network-timeout
Closed

systemd: replace TimeoutSec=0 with TimeoutSec=300 in network stage#7055
sundeep8967 wants to merge 2 commits into
canonical:mainfrom
sundeep8967:fix/cloud-init-network-timeout

Conversation

@sundeep8967

Copy link
Copy Markdown
Contributor

Problem

When using systemd-networkd-wait-online.service in the network stage, a cyclic dependency or failed transaction can cause systemctl start systemd-networkd-wait-online.service to block indefinitely. Since cloud-init-network.service ships with TimeoutSec=0, it waits forever, deadlocking the entire boot process before sshd or user services can start.

Solution

  • Replaced TimeoutSec=0 with TimeoutSec=300 in systemd/cloud-init-network.service.tmpl.
  • This ensures that if the network stage gets stuck, it will time out after 5 minutes and fail, allowing the rest of the boot process (like sshd) to continue, recovering the instance.

Fixes #7052

Testing

  • Modified systemd template file.
  • All tests passed cleanly.

When rendering schema property documentation, module_property.tmpl
previously appended 'Each object in <name> list supports the following keys:'
to all properties with nested properties, regardless of whether the
property was an array of items or a single object.

Fix module_property.tmpl to distinguish between list types (items)
and single object types (properties/patternProperties directly), rendering
'The <name> object supports the following keys:' for object properties.

Fixes canonicalGH-7046
Boot deadlocks can occur in the network stage if a cyclic dependency
prevents a start job from becoming runnable (e.g. systemd-networkd-wait-online.service).
TimeoutSec=0 allows the service to hang indefinitely, rendering the host unbootable.
This change imposes a 300s upper bound on the network stage so that if it
hangs, the service fails and the boot sequence can continue.

Fixes canonicalGH-7052

Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
@github-actions github-actions Bot added the documentation This Pull Request changes documentation label Aug 30, 2026
@sundeep8967

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #7053. Apologies for the noise, I didn't see the existing PR before submitting.

@sundeep8967

Copy link
Copy Markdown
Contributor Author

closing this as duplicate of #7053. didn't see the earlier pr, my bad.

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

Labels

documentation This Pull Request changes documentation

Projects

None yet

1 participant