Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to use udev rules in order to give my network interfaces static, consistent names. However, it seems like there is some race condition happening preventing these rules from consistently taking effect each boot.

When I look at journalctl I see the following error message:

systemd-udevd[149]: error changing net interface name eth0 to net0: Device or resource busy

My rules are pretty straight forward, I took them straight from the arch wiki on Network Configuration

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="xx:xx:xx:xx:xx:xx", NAME="wifi0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="xx:xx:xx:xx:xx:xx", NAME="net0"

What could be using the interfaces so early in the boot, and what can I do to fix this?

share|improve this question
    
Can you post output of cat /etc/netctl/mynetwork and also /etc/conf.d/network@<interface> –  Rahul Patil Sep 15 '13 at 20:07
    
@RahulPatil I'm not using netctl. I'm running dhcp, ifplug, and wpa_supplicant with systemd –  Mike C Sep 15 '13 at 20:17
    
Possibly related: bugs.freedesktop.org/show_bug.cgi?id=56929 –  Martin von Wittich Sep 16 '13 at 0:22
    
I think I've narrowed it down to the dhcpcd service started by systemd. If I don't start dhcpcd on boot, then the devices are renamed. What I can't figure out is how to force dhcpcd to start after the renames after taken place. –  Mike C Sep 25 '13 at 0:51

1 Answer 1

Some way to a workaround/solution for this problem is to use systemd-networkd. Set up a config file at /etc/systemd/network/net0dhcp.network (or similar) to:

[Match]
Name=net0
[Network]
DHCP=true

Rename net0 in the above to the appropriate network interface name. Now:

systemctl disable dhcpcd
systemctl enable systemd-networkd

And reboot. (You can probably restart some services or something; I didn't find which ones- rebooting was quick enough).

I have only tested this with a wired network (and don't have a machine with a wifi card lying around at the moment) so can't comment on how this configuration will work with your wireless interface. My assumption is that you'll need to add a configuration file for that interface and things will be peachy. Of course if it doesn't work out that easy, you can always just:

systemctl disable systemd-networkd
systemctl enable dhcpcd

And restart.

More info: https://wiki.archlinux.org/index.php/Systemd-networkd#Basic_DHCP_network

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.