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
Bug 1832897 - network-scripts needs to depend on dbus-tools for NetworkManager detection
Summary: network-scripts needs to depend on dbus-tools for NetworkManager detection
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 32
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Lukáš Nykrýn
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2020-05-07 12:55 UTC by Till Maas
Modified: 2021-05-25 16:10 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-05-25 16:10:11 UTC
Type: Bug

Attachments (Terms of Use)

Description Till Maas 2020-05-07 12:55:43 UTC
Description of problem:
network-scripts is_nm_running does not work

Version-Release number of selected component (if applicable):

How to reproduce:
[root@f32-cloud ~]# (. /etc/sysconfig/network-scripts/network-functions; is_nm_running && echo "yes")
[root@f32-cloud ~]# yum install dbus-tools
Last metadata expiration check: 0:02:15 ago on Thu 07 May 2020 12:50:30 PM UTC.
Dependencies resolved.
 Package                                          Architecture                                 Version                                                   Repository                                    Size
 dbus-tools                                       x86_64                                       1:1.12.16-4.fc32                                          fedora                                        56 k

Transaction Summary
Install  1 Package

Total download size: 56 k
Installed size: 134 k
Is this ok [y/N]: y
Downloading Packages:
dbus-tools-1.12.16-4.fc32.x86_64.rpm                                                                                                                                        2.4 MB/s |  56 kB     00:00    
Total                                                                                                                                                                       104 kB/s |  56 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                    1/1 
  Installing       : dbus-tools-1:1.12.16-4.fc32.x86_64                                                                                                                                                 1/1 
  Running scriptlet: dbus-tools-1:1.12.16-4.fc32.x86_64                                                                                                                                                 1/1 
  Verifying        : dbus-tools-1:1.12.16-4.fc32.x86_64                                                                                                                                                 1/1 


[root@f32-cloud ~]# (. /etc/sysconfig/network-scripts/network-functions; is_nm_running && echo "yes")

Comment 1 Till Maas 2020-05-07 20:53:50 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:

Comment 2 Pavel Cahyna 2020-05-07 20:59:47 UTC
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

Comment 3 Till Maas 2020-05-08 09:36:56 UTC
(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.

Comment 4 Thomas Haller 2020-05-08 10:16:21 UTC
> 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?

Comment 5 Till Maas 2020-05-11 10:27:40 UTC

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

Comment 6 Till Maas 2020-07-06 18:44:09 UTC
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}"

Comment 7 Fedora Program Management 2021-04-29 16:24:28 UTC
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.

Comment 8 Ben Cotton 2021-05-25 16:10:11 UTC
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

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.