Skip to content

Mask NetworkManager-wait-online.service during boot#14272

Merged
benhillis merged 3 commits into
microsoft:masterfrom
dhtzs:mask-networkmanager-wait-online
Feb 26, 2026
Merged

Mask NetworkManager-wait-online.service during boot#14272
benhillis merged 3 commits into
microsoft:masterfrom
dhtzs:mask-networkmanager-wait-online

Conversation

@dhtzs

@dhtzs dhtzs commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Fixes #13772. Similar to PR #13611, this masks NetworkManager-wait-online.service to prevent 60-second timeouts during boot since WSL interfaces are unmanaged by NetworkManager. Also added the service to the discouraged units list in validate-modern.py and added a unit test.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Fixes microsoft#13772. Similar to PR microsoft#13611, this masks NetworkManager-wait-online.service to prevent 60-second timeouts during boot since WSL interfaces are unmanaged by NetworkManager. Also added the service to the discouraged units list in validate-modern.py and added a unit test.
Copilot AI review requested due to automatic review settings February 25, 2026 13:48
@dhtzs dhtzs requested a review from a team as a code owner February 25, 2026 13:48
@dhtzs

dhtzs commented Feb 25, 2026

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #13772 by masking the NetworkManager-wait-online.service during WSL boot to prevent 60-second timeouts. This follows the same pattern established in PR #13611 for systemd-networkd-wait-online.service. The service times out because WSL network interfaces are unmanaged by NetworkManager, causing the service to wait indefinitely for an event that never occurs.

Changes:

  • Masks NetworkManager-wait-online.service by creating a symlink to /dev/null during systemd unit generation
  • Adds unit test to verify the service is properly masked
  • Adds the service to the discouraged units list in distribution validation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/linux/init/init.cpp Adds symlink creation to mask NetworkManager-wait-online.service, following the same pattern as systemd-networkd-wait-online.service
test/windows/UnitTests.cpp Adds test to verify NetworkManager-wait-online.service is masked, mirroring the existing test for systemd-networkd-wait-online.service
distributions/validate-modern.py Adds NetworkManager-wait-online.service to the DISCOURAGED_SYSTEM_UNITS list for distribution validation
Comment thread test/windows/UnitTests.cpp Outdated
Comment thread test/windows/UnitTests.cpp Outdated
@benhillis

Copy link
Copy Markdown
Member

This looks good to me, thanks for making the change!

@benhillis

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).
@benhillis

Copy link
Copy Markdown
Member

D:\a_work\1\s\test\windows\UnitTests.cpp(222,22): error C2374: '': redefinition; multiple initialization [D:\a_work\1\s\test\windows\wsltests.vcxproj]
(compiling source file 'UnitTests.cpp')
D:\a_work\1\s\test\windows\UnitTests.cpp(216,20):
see declaration of '
'

D:\a_work\1\s\test\windows\UnitTests.cpp(222,22): error C2386: '_': a symbol with this name already exists in the current scope [D:\a_work\1\s\test\windows\wsltests.vcxproj]
(compiling source file 'UnitTests.cpp')

@benhillis

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@OneBlue OneBlue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Thank you !

@benhillis benhillis merged commit cb35b51 into microsoft:master Feb 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants