Bugzilla – Bug 1211677
systemctl reload-or-restart network.service appears to do nothing with NetworkManager active
Last modified: 2024-07-01 06:09:19 UTC
When Wicked is active systemctl [reload-or-]restart network.service causes the DHCP leases to be renewed. It also appears to wait for this to happen. The result being that we can reliably modify the hostname and propagate the change up to the local DNS server using dynamic DNS over DHCP. This is used in OpenQA. For reference see this workaround PR: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/17135 Presently when NetworkManager is active we use some nmcli commands directly to get the same effect (see above PR, idk if this is the best way). It's not clear what effect systemctl restart has if any. My expectation would be that restarting network.service has approximately the same effect regardless of the underlying daemon. Intuitively restarting the network service should also completely flush all network config.
FYI 'nmcli network off' caused an unwanted side effect in KDE: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/17170
Hi Songchuan, would you please help to take a look at this issue? Please feel free to reassign whenever necessary, thanks.
(In reply to Richard Palethorpe from comment #0) > My expectation would be that restarting network.service has approximately > the same effect regardless of the underlying daemon. Intuitively restarting > the network service should also completely flush all network config. Stopping NetworkManager won't take down network interfaces. This is intended by NetworkManager. So simply restarting NetworkManager.serivce doesn't flush network configurations. You can also try `nmcli connection down $conn-id ; nmcli connection up $conn-id`.
Closing this as explained in comment#3.