Hi! I've been trying to write a unit template to configure the network (systemd version: 187): File: net-static@.service [Unit] Description=Static interface Wants=network.target Before=network.target #BindTo=sys-subsystem-net-devices-%i.device #After=sys-subsystem-net-devices-%i.device [Service] ... Now, if I uncomment any of the lines that make a reference to the device alias, then the alias itself disappears! When I say that the alias disappears, I mean that it is no longer an alias of the real device, instead it looks like systemd believes it is a proper unit in its own, and I can see it in the output of `systemctl --all`: loaded inactive dead, without meaningful description. If the BindTo is uncommented, that means that this unit cannot start: it tries to start the sys-subsystem-net-devices-eth0.device unit, and it times out. If only the After is uncommented, then this unit is started anyway. However, if I write the BindTo/After using the full name of the device (BindTo=sys-devices-pci0000:00-0000:00:03.0-net-eth0.device) then it works as expected). But that's not so useful, because I'm writing a template so I really need to use the alias. Is my unit expected to work or am I totally misunderstanding aliases? Regards -- Rodrigo
Yeah, this is definitely a bug -- it breaks ordering for DHCP clients and wpa_supplicant. The only workaround I know of at the moment is to explicitly load the module in /etc/modules-load.d to give the interface a better chance of existing when your unit runs. I reported this a while ago, as well: http://lists.freedesktop.org/archives/systemd-devel/2012-July/005847.html It's still valid in 189.
This bug also affects me. In my case, it's a USB-to-Ethernet adaptor that gets different USB addresses assigned by the kernel (usb7-7\x2d3-7\x2d3:1.0 or usb3-3\x2d3-3\x2d3:1.0). Since I can't use the device alias, as a work-around, I have to rewrite my service file upon every second reboot. Fixing this bug would be greatly appreciated. Markus
I've posted a patch on the systemd-devel list that should fix this problem: http://lists.freedesktop.org/archives/systemd-devel/2012-October/006872.html
Thanks Eelco, I pulled your patch for inclusion in the next release.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.