Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1832897
Summary: | network-scripts needs to depend on dbus-tools for NetworkManager detection | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Till Maas <till> |
Component: | initscripts | Assignee: | Lukáš Nykrýn <lnykryn> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 32 | CC: | deekej, jamacku, john.j5live, jonathan, kdudka, kzak, lnykryn, thaller, zbyszek |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-05-25 16:10:11 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: |
Description
Till Maas
2020-05-07 12:55:43 UTC
This seems to break the NM_CONTROLLED=no feature since network-scripts will not trigger NM to load a profile. The Fedora cloud images do not install dbus-tools, therefore I noticed this: https://github.com/linux-system-roles/network/pull/219 Would "nmcli general" work? It returns a nonzero exist status when it fails to contact NetworkManager. If one needs a more specific status, one could check the output of nmcli --terse --fields state general (In reply to Pavel Cahyna from comment #2) > Would "nmcli general" work? It returns a nonzero exist status when it fails > to contact NetworkManager. If one needs a more specific status, one could > check the output of > nmcli --terse --fields state general It is using dbus-send also in other functions. These are the functions that I found: nm_con_load () { dbus-send --system --print-reply \ --dest=org.freedesktop.NetworkManager \ /org/freedesktop/NetworkManager/Settings \ org.freedesktop.NetworkManager.Settings.LoadConnections \ array:string:"/etc/sysconfig/network-scripts/${1}" >/dev/null 2>&1 } get_uuid_by_config () { dbus-send --system --print-reply --dest=com.redhat.ifcfgrh1 /com/redhat/ifcfgrh1 com.redhat.ifcfgrh1.GetIfcfgDetails string:"/etc/sysconfig/network-scripts/$1" 2>/dev/null | awk -F '"' '/string / { print $2 }' } is_nm_running () { dbus-send --system --print-reply \ --dest=org.freedesktop.DBus \ /org/freedesktop/DBus \ org.freedesktop.DBus.GetNameOwner \ string:"org.freedesktop.NetworkManager" >/dev/null 2>&1 } Not sure, if they all of them could be done with nmcli, Thomas would now. > Not sure, if they all of them could be done with nmcli, Thomas would now.
The call to GetIfcfgDetails could not be done via nmcli.
nmcli still is usually slower than a plain D-Bus call. That is, because in most modes, nmcli will fetch the entire state first, which (on my machine) takes relatively long with ~80ms, compared to a plain dbus-send call.
D-Bus is really a sensible API on it's own (and stable). It's perfectly fine for simple uses to directly talk D-Bus. There is little need to pay the overhead.
Nowadays, systemd package provides /usr/bin/busctl. Maybe a better solution would be to use busctl instead of dbus-send?
is_nm_running() could be implemented like this AFAICS: busctl --system call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus GetNameOwner s org.freedesktop.NetworkManager >/dev/null 2>&1 busctl implementation for nm_con_load(): busctl --system call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager/Settings org.freedesktop.NetworkManager.Settings LoadConnections "as" "/etc/sysconfig/network-scripts/${1}" This message is a reminder that Fedora 32 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '32'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 32 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |