Support `networkd-dispatcher`
I realized that the nslcd.if-up
script could be easily adjusted to
also support networkd-dispatcher
-style scripts.
Ubuntu uses systemd-networkd
and is working towards supporting
networkd-dispatcher
instead of ifupdown
. I'd like to proposed
this MR so that Debian can also benefit from this.
The idea is simple: after adjusting the existing script, we just have
to install it into the /usr/lib/networkd-dispatcher/routable.d/
directory. I chose to create a link in order to avoid duplication.
I did a quick test inside an Ubuntu VM with the new version of the package. I brought the network interface down and then up, and here's the log:
Oct 12 18:31:34 nslcd-impish systemd-networkd[526]: enp5s0: Link UP
Oct 12 18:31:34 nslcd-impish systemd-networkd[526]: enp5s0: Gained carrier
Oct 12 18:31:34 nslcd-impish systemd-networkd[526]: enp5s0: DHCPv4 address 10.101.133.232/24 via 10.101.133.1
Oct 12 18:31:34 nslcd-impish systemd-timesyncd[463]: Network configuration changed, trying to establish connection.
Oct 12 18:31:34 nslcd-impish nscd[1710]: 1710 monitoring file `/etc/nsswitch.conf` (12)
Oct 12 18:31:34 nslcd-impish nscd[1710]: 1710 monitoring directory `/etc` (2)
Oct 12 18:31:34 nslcd-impish nscd[1710]: 1710 monitoring file `/etc/resolv.conf` (5)
Oct 12 18:31:34 nslcd-impish nscd[1710]: 1710 monitoring directory `/etc` (2)
Oct 12 18:31:34 nslcd-impish networkd-dispatcher[2257]: * Sending network state change signal to nslcd...
Oct 12 18:31:34 nslcd-impish nslcd[1934]: caught signal SIGUSR1 (10), refresh retries
Oct 12 18:31:34 nslcd-impish networkd-dispatcher[2257]: ...done.
As can be seen, nslcd
is successfully notified by
networkd-dispatcher
that the interface is up.