On Fri, 2019-08-09 at 14:43 +0100, Mike Fleetwood wrote:
I fixed this earlier this morning. I stopped the systemd managed NetworkManager service. Even with the service stopped dhclient was still running in the control group managed by systemd. Manually killed dhclient [1]. (Rethorical question, how is that even allowed? Surely the point of systemd using CGroups is so that it can identify all processes for a service, which it did, and that when stopping a service it ensures all processes stop or are killed, but it didn't). Then I manually removed the unwanted DHCP assigned IP address again and restarted the NetworkManager servers. No dhclient running this time [2].
Hi, your reply here is not very clear (regarding my earlier question), but I presume that you earlier only modified the profile without further action. Note that there is a difference between a connection profile and a (what NetworkManager calls) a device. A profile is just a a bunch of settings that describe how to configure a device. You see that in `nmcli connection show`, and that is what what the commands under `nmcli connection` operate on. A device is what you see in `nmcli device`, and (in case of most device types like ethernet) corresponds to what you see in `ip link show`. A device is subject to be configured by NetworkManager: by "activating" a connection profile. If you only modify a profile that is currently active, then these changes don't take effect immediately. Commonly you need to re-activate the profile first, like `nmcli connection up $PROFILE`. Rebooting you machine would work too... but reboot is certainly not the suggested way. Instead, just reactive the profile.
[1] Stopped NetworkManager, but dhclient still running. Killed it.
When you stop the NetworkManager service it aims to leave all devices up. The purpose is so that you can restart/update the service without disconnecting yourself from the network. Optimally, restarting NetworkManager should be seamless and you shouldn't even notice. Hence, restart NetworkManager is never the right approach to have some changes (to a profile) to take effect, because NeworkManager tries *not* to do any changes. You should (almost) never be required to restart NetworkManager. Of course, you may restart to update the service or change certain configuration options in NetworkManager.conf that cannot be reloaded via `systemctl reload NetworkManager.service`. But usually it's the wrong thing to do. Systemd doesn't kill dhclient because # systemctl cat NetworkManager.service | grep KillMode KillMode=process best, Thomas
Attachment:
signature.asc
Description: This is a digitally signed message part