Skip to content

Extend ifupdown script to support networkd-dispatcher

Hi,

Ubuntu uses systemd-networkd and is working towards supporting networkd-dispatcher instead of ifupdown. I'd like to propose this MR so that Debian can also benefit from this.

I noticed that the existing ifupdown script that clamav uses (a) could use some code improvements, and (b) could be expanded to also handle networkd-dispatcher.

I'm also proposing an addition to the clamav-freshclam.links file in order to properly link the scripts under /etc/network/if-{up,down}.d/ to /usr/lib/networkd-dispatcher/{routable,off}.d/, in order to prevent code 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 also added a few temporary debugging statements in order to make sure that the right scripts were being executed. Here's the log:

# ip link set enp5s0 down
Oct 14 01:14:21 ifupdown-bug1718227 networkd-dispatcher[2475]: -------> Executing /usr/lib/networkd-dispatcher/off.d/clamav-freshclam
Oct 14 01:14:21 ifupdown-bug1718227 systemd[1]: Stopping ClamAV virus database updater...
Oct 14 01:14:21 ifupdown-bug1718227 freshclam[2464]: Thu Oct 14 01:14:21 2021 -> Update process terminated
Oct 14 01:14:21 ifupdown-bug1718227 systemd[1]: clamav-freshclam.service: Deactivated successfully.
Oct 14 01:14:21 ifupdown-bug1718227 systemd[1]: Stopped ClamAV virus database updater.
Oct 14 01:14:21 ifupdown-bug1718227 networkd-dispatcher[2475]: -------> Executed /usr/lib/networkd-dispatcher/off.d/clamav-freshclam

# ip link set enp5s0 up
Oct 14 01:15:28 ifupdown-bug1718227 networkd-dispatcher[2490]: ========> Executing /usr/lib/networkd-dispatcher/routable.d/clamav-freshclam
Oct 14 01:15:28 ifupdown-bug1718227 systemd[1]: Started ClamAV virus database updater.
Oct 14 01:15:28 ifupdown-bug1718227 networkd-dispatcher[2490]: ========> Executed /usr/lib/networkd-dispatcher/routable.d/clamav-freshclam

Merge request reports

Loading