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

Updated NetworkManager calls in suspend/resume scripts. #699

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eerykitty
Copy link

The org.freedesktop.NetworkManager.Enable method used by the suspend/resume scripts changes the NetworkEnabled state in NM, which is persisted to disk in the state file (typically at /var/lib/NetworkManager/NetworkManager.state).

If the resume script fails for any reason at all, the system will be left with NetworkManager in a disabled state, where the service is running, but all interfaces are ignored by NM, and most GUI interfaces will show the network as simply disappeared, as opposed to indicating it is disabled.

This code was added in commit 13ab4cc, which indicates that Enabled is tried first due to a bug in NM 0.9 on Ubuntu 11.10. I have confirmed that at least NM 0.9.1 on Ubuntu 11.10 correctly responds to Sleep, and several modern Linux distributions with modern copies of NM appear to respond correctly.

Use of the Sleep method is preferred, as the change does not persist a cold (re)boot, and avoids potentially leaving the system in state that's confusing to users.

I believe this to be the cause of a problem I've recently encountered, as well as a possible culprit of #426, along with many reports of similar problems across the web. A Google search for vmware "nmcli networking on" or just "nmcli networking on" shows many reports where networking "disappears" from guests, where the nmcli command is able to "fix" the problem.

With the exception of the nmcli tool itself, this network script appears to be the only widespread user of the Enabled dbus method. Outside of manually editing the state file, this is the only way to toggle the NetworkEnabled state, which is not really represented in the UI, especially in GUI frontends for NetworkManager. Since nothing else will ever toggle the NetworkEnabled state automatically, I believe the issue has to be the resume script not running for whatever reason, and leaving NM disabled.

The org.freedesktop.NetworkManager.Enable method used by the
suspend/resume scripts changes the NetworkEnabled state in NM,
which is disk-persisted.

If the resume script fails for any reason at all, the system will be
left with NetworkManager in a disabled state, where the service
is running, but all interfaces are ignored by NM. This change was made
in commit 13ab4cc due to NM 0.9
on Ubuntu 11.10 not responding to the Sleep method. I have confirmed
that at least NM 0.9.1 on Ubuntu 11.10 correctly responds to Sleep,
and several modern Linux distributions with modern copies of NM
respond correctly.

Use of the Sleep method is preferred, as the change does not persist a
cold (re)boot, and avoids potentially leaving the system in a confusing
state.
@vmwclabot
Copy link
Member

@eerykitty, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@vmwclabot
Copy link
Member

@eerykitty, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

@vmwclabot
Copy link
Member

@eerykitty, VMware has approved your signed contributor license agreement.

@johnwvmw
Copy link
Contributor

johnwvmw commented Dec 8, 2023

@eerykitty Thanks for your contribution. Your contribution will go through a review process at VMware. An update will be provided once the review is completed.

Hi Joseph,
I will file an internal problem report (PR) to track updating the Newtork Manager calls in the Linux "network" script. We will need to test the change in other Linux versions with various versions of the Network Manager.

You can help with this by providing additional details on what specific Linux distributions and versions and the specific version of Network Manager used in each.

Thanks.

vmwkruti1111 pushed a commit that referenced this pull request Apr 10, 2024
Revise the NetworkManager calls in the Linux network script to
prefer using the Sleep method over the "Enable" method being used
to work around a bug in version 0.9.0.

Pull request: #699
Issue: #426
vmwkruti1111 pushed a commit that referenced this pull request Jun 7, 2024
Revise the NetworkManager calls in the Linux network script to
prefer using the Sleep method over the "Enable" method being used
to work around a bug in version 0.9.0.

Pull request: #699
Issue: #426
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.

3 participants