This avoids starting these units in vain if networkd is not being used. Note
that we can't just use "is-active", as these rules might already get triggered
at boot when networkd is not running yet.
With this, networkd becomes compatible with ifupdown and NetworkManager for
packages shipping hooks.
- Add debian/extra/units/networkd-if-up.d@.service: Wait for a particular
interface to be up, and call if-up.d/ for it if it is managed by
networkd. Correspondingly, call if-post-down.d/ scripts when stopping.
- debian/extra/udev-helpers/net.agent: Start/stop
networkd-if-up.d@.service when interfaces appear/go away.
- debian/tests/networkd: Verify that if-up.d/ and if-post-down.d/ scripts
get run for a networkd managed interface.
Note that if-pre-up.d/ and if-down.d/ scripts are *not* being called + (like
NetworkManager), as they are unnecessary (if-pre-up.d) and unreliable
(if-down.d).
See Ubuntu blueprint for details:
https://blueprints.launchpad.net/ubuntu/+spec/foundations-w-networkd-vs-ifupdown