Comment 44 for bug 293139

Revision history for this message
In , Mike (mike-redhat-bugs) wrote :

Scripts in /etc/NetworkManager/dispatcher.d/ do work, but they don't fully
handle the sorts of things the dhclient-script and friends did. It's certainly
less featureful.

For example, when dhclient does a renew, NetworkManager does not run any script
in /etc/NetworkManager/dispatcher.d/. Those only seem to be run when
NetworkManager changes state on a device using either "up" or "down".
NetworkManager's actions after the renew causes some other services to have to
rediscover the interface:

Jul 10 01:48:22 laptop dhclient: DHCPREQUEST on wlan0 to 192.168.1.1 port 67
Jul 10 01:48:22 laptop dhclient: DHCPACK from 192.168.1.1
Jul 10 01:48:22 laptop dhclient: bound to 192.168.1.6 -- renewal in 42559 seconds.
Jul 10 01:48:22 laptop NetworkManager: <info> DHCP: device wlan0 state changed
bound -> renew
Jul 10 01:48:22 laptop NetworkManager: <info> address 192.168.1.6
Jul 10 01:48:22 laptop NetworkManager: <info> netmask 255.255.255.0
Jul 10 01:48:22 laptop NetworkManager: <info> gateway 192.168.1.1
Jul 10 01:48:22 laptop NetworkManager: <info> nameserver '127.0.0.1'
Jul 10 01:48:22 laptop avahi-daemon[2579]: Withdrawing address record for
192.168.1.6 on wlan0.
Jul 10 01:48:22 laptop avahi-daemon[2579]: Leaving mDNS multicast group on
interface wlan0.IPv4 with address 192.168.1.6.
Jul 10 01:48:22 laptop avahi-daemon[2579]: Interface wlan0.IPv4 no longer
relevant for mDNS.
Jul 10 01:48:22 laptop avahi-daemon[2579]: Joining mDNS multicast group on
interface wlan0.IPv4 with address 192.168.1.6.
Jul 10 01:48:22 laptop avahi-daemon[2579]: New relevant interface wlan0.IPv4 for
mDNS.
Jul 10 01:48:22 laptop avahi-daemon[2579]: Registering new address record for
192.168.1.6 on wlan0.IPv4.
Jul 10 01:48:23 laptop NetworkManager: <info> Policy set (wlan0) as default
device for routing and DNS.

I run openvpn as a service, outside of NetworkManager. Using the normal
dhclient-script hooks, I can detect this action and restart the openvpn service
when it happens. The /usr/libexec/nm-dhcp-client.action script NetworkManager
runs from dhclient doesn't appear to be able to handle the same idea of hooks.
Without a cronjob watching things, or modifying NetworkManager's init script to
use the normal dhclient-script, I have to manually restart openvpn everytime
DHCP renews. It tends to be less than transparent.

Should this replacement for dhclient-script read and handle the same hooks files
that dhclient-script itself uses, or should NetworkManager itself not make
changes to an interface like this when a simple renew happens? Ideally,
functionality replaced should not be a reduction. I'd like to see the hooks work.