mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-15 13:00:19 +01:00
We silently tolerate NetworkManager not responding at all (easily
reproduced with e.g. pkill -STOP NetworkManager):
$ LIBNM_CLIENT_DEBUG=trace nmcli c show dummy666
libnm-dbus[23540]: <debug> [3316.81989] nmclient[ddafb84b8deebe4a]: new NMClient instance
libnm-dbus[23540]: <debug> [3316.81998] nmclient[ddafb84b8deebe4a]: starting async initialization...
libnm-dbus[23540]: <debug> [3316.82461] nmclient[ddafb84b8deebe4a]: name owner changed: (null) -> ":1.2"
libnm-dbus[23540]: <debug> [3316.82464] nmclient[ddafb84b8deebe4a]: fetch all
libnm-dbus[23540]: <debug> [3341.85715] nmclient[ddafb84b8deebe4a]: GetManagedObjects() call failed: Timeout was reached
libnm-dbus[23540]: <debug> [3341.85740] nmclient[ddafb84b8deebe4a]: async init complete with success
Error: dummy666 - no such connection profile.
libnm-dbus[23540]: <debug> [3341.86723] nmclient[ddafb84b8deebe4a]: release all
libnm-dbus[23540]: <debug> [3341.86798] nmclient[ddafb84b8deebe4a]: disposed
$
As a comment in _dbus_get_managed_objects_cb() explains, this is sort of
intentional. NetworkManager might just be shutting down and the libnm
users will eventually see the objects once a new daemon starts up.
This may make some sense for long-running clients ("nmcli monitor",
various desktop environments), but not for one-shot invocations that
require the daemon running, such as those of "nmcli c ...".
Let's not consider the client running unless we actually got the manager
object. That way the error message will make more sense:
$ LIBNM_CLIENT_DEBUG=trace nmcli c show dummy666
libnm-dbus[24730]: <debug> [5360.95480] nmclient[8cb898d3c891e210]: new NMClient instance
libnm-dbus[24730]: <debug> [5360.95487] nmclient[8cb898d3c891e210]: starting async initialization...
libnm-dbus[24730]: <debug> [5360.95901] nmclient[8cb898d3c891e210]: name owner changed: (null) -> ":1.2"
libnm-dbus[24730]: <debug> [5360.95904] nmclient[8cb898d3c891e210]: fetch all
libnm-dbus[24730]: <debug> [5385.98487] nmclient[8cb898d3c891e210]: GetManagedObjects() call failed: Timeout was reached
libnm-dbus[24730]: <debug> [5385.98497] nmclient[8cb898d3c891e210]: async init complete with success
Error: NetworkManager is not running.
libnm-dbus[24730]: <debug> [5385.98571] nmclient[8cb898d3c891e210]: release all
libnm-dbus[24730]: <debug> [5385.98698] nmclient[8cb898d3c891e210]: disposed
$
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1502
|
||
|---|---|---|
| .. | ||
| tests | ||
| libnm.pc.in | ||
| libnm.ver | ||
| meson.build | ||
| nm-access-point.c | ||
| nm-active-connection.c | ||
| nm-checkpoint.c | ||
| nm-client.c | ||
| nm-conn-utils.c | ||
| nm-dbus-helpers.c | ||
| nm-dbus-helpers.h | ||
| nm-default-libnm.h | ||
| nm-device-6lowpan.c | ||
| nm-device-adsl.c | ||
| nm-device-bond.c | ||
| nm-device-bridge.c | ||
| nm-device-bt.c | ||
| nm-device-dummy.c | ||
| nm-device-ethernet.c | ||
| nm-device-generic.c | ||
| nm-device-infiniband.c | ||
| nm-device-ip-tunnel.c | ||
| nm-device-loopback.c | ||
| nm-device-macsec.c | ||
| nm-device-macvlan.c | ||
| nm-device-modem.c | ||
| nm-device-olpc-mesh.c | ||
| nm-device-ovs-bridge.c | ||
| nm-device-ovs-interface.c | ||
| nm-device-ovs-port.c | ||
| nm-device-ppp.c | ||
| nm-device-private.h | ||
| nm-device-team.c | ||
| nm-device-tun.c | ||
| nm-device-veth.c | ||
| nm-device-vlan.c | ||
| nm-device-vrf.c | ||
| nm-device-vxlan.c | ||
| nm-device-wifi-p2p.c | ||
| nm-device-wifi.c | ||
| nm-device-wimax.c | ||
| nm-device-wireguard.c | ||
| nm-device-wpan.c | ||
| nm-device.c | ||
| nm-dhcp-config.c | ||
| nm-dhcp4-config.c | ||
| nm-dhcp4-config.h | ||
| nm-dhcp6-config.c | ||
| nm-dhcp6-config.h | ||
| nm-dns-manager.c | ||
| nm-dns-manager.h | ||
| nm-ip-config.c | ||
| nm-ip4-config.c | ||
| nm-ip4-config.h | ||
| nm-ip6-config.c | ||
| nm-ip6-config.h | ||
| nm-libnm-utils.c | ||
| nm-libnm-utils.h | ||
| nm-object-private.h | ||
| nm-object.c | ||
| nm-remote-connection-private.h | ||
| nm-remote-connection.c | ||
| nm-secret-agent-old.c | ||
| nm-vpn-connection.c | ||
| nm-vpn-editor.c | ||
| nm-vpn-plugin-old.c | ||
| nm-vpn-service-plugin.c | ||
| nm-wifi-p2p-peer.c | ||
| nm-wimax-nsp.c | ||
| README.md | ||
libnm-client-impl
libnm is NetworkManager's client API. This API consists of two parts:
- the handling of connections (
NMConnection), implemented by libnm-core-impl. - the caching of D-Bus API (
NMClient), implemented by libnm-client-impl.
This directory contains the implementation of the second part. As such, it will be statically linked with libnm-core-impl to make libnm. Also, it cannot be used by the daemon.