On Mon, Jul 13, 2015 at 12:50 AM, Toke Høiland-Jørgensen <t...@toke.dk> wrote:
> Hi > > I'm trying to port a set of traffic shaping scripts (sqm-scripts) from > OpenWrt to Arch Linux. I would like to be able to have a systemd unit > be run when an interface is configured (by systemd-networkd). Kinda like > the if-up.d facility in some distros, I guess... > > I figured out that I can depend on the interface *appearing* by using > > BindsTo=sys-subsystem-net-devices-%i.device > After=sys-subsystem-net-devices-%i.device > > ...but is there also a way to get a unit to run when an interface is > configured? > Systemd doesn't know when an interface is /finally/ configured (e.g. maybe the configurator added one address but is still about to add more; maybe it added an IPv6 address but is still waiting for DHCPv4; maybe it finished with addresses but is still configuring routes...) So you really need this to be part of the configurator itself. As a direct equivalent to if-up.d, NetworkManager has dispatcher.d, but systemd-networkd doesn't yet have anything such. However, both NM and networkd have "is-online" tools, for example, *systemd-networkd-wait-online.service*, which your unit can depend on. Note that by default it waits for *all* interfaces to be configured; if you only need a specific one, you can create your own (instanced/templated) version that would use "--interface=%i". See also `man systemd-networkd-wait-online`. -- Mantas Mikulėnas <graw...@gmail.com>
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel