+++ This bug was initially created as a clone of Bug #1345919 +++
+++ This bug was initially created as a clone of Bug #1344411 +++
Scenario:
- NetworkManager is running, with monitor-connection-files=no (which is the default). Currently NetworkManager is managing the interface "eth0", for example because there is no ifcfg file with NM_CONTROLLED=no.
- user creates a new ifcfg-eth0, with NM_CONTROLLED=no
- user calls `ifup eth0`
Result:
NetworkManager does not learn that it should not manage the configuration. Instead, ifup will activate eth0 without using nmcli, and NetworkManager continues to interfere.
That is due to:
if ! is_false $NM_CONTROLLED && is_nm_running; then
nmcli con load "/etc/sysconfig/network-scripts/$CONFIG"
UUID=$(get_uuid_by_config $CONFIG)
[ -n "$UUID" ] && _use_nm=true
fi
Expected Behavior:
ifup should notify NetworkManager to reload the file. Like:
if is_nm_running; then
nmcli con load "/etc/sysconfig/network-scripts/$CONFIG"
if ! is_false $NM_CONTROLLED; then
UUID=$(get_uuid_by_config $CONFIG)
[ -n "$UUID" ] && _use_nm=true
fi
fi
--- Additional comment from Lukáš Nykrýn on 2016-06-13 15:48:42 IDT ---
Change looks sane to me -> devel_ack.
--- Additional comment from Thomas Haller on 2016-06-13 15:59:33 IDT ---
Maybe we should also replace
nmcli con load "/etc/sysconfig/network-scripts/$CONFIG"
with
dbus-send --system --print-reply \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager/Settings \
org.freedesktop.NetworkManager.Settings.LoadConnections \
array:string:"/etc/sysconfig/network-scripts/$CONFIG"
On a quick test (on my particular machine), the dbus-send call takes about 4ms, while the nmcli call takes 215ms.