[systemd-devel] Renaming network interfaces: device or resource busy

Colin Guthrie gmane at colin.guthr.ie
Mon Sep 30 08:49:08 PDT 2013


'Twas brillig, and Thomas Bächler at 30/09/13 16:42 did gyre and gimble:
> Am 30.09.2013 17:14, schrieb Colin Guthrie:
>> Hi,
>>
>> Just trying to debug the problem mentioned in the subject. I'm wanting
>> to use the new device names in stage 2 of our installer (some closing
>> config routines write the interface name into some conf files etc), but
>> when udev rules kick in, the device is already up and in use... is there
>> any way to work out what is using it and preventing the rename?
>>
>> I would guess fuser or netstat but not quite sure what to look for.
>> Simply running netstat only shows unix sockets, no tcp/udp ones...
>>
>> Any help appreciated.
> 
> Any application that listens on netlink for new network interfaces may
> start using the interface before udev has finished processing the uevent.
> 
> IMO, this needs to be fixed in the kernel and udev, so that udev can
> have a chance to finish its uevent processing before the interface is
> announced via netlink. As far as I know, no work in that direction has
> been done.
> 
> We had such a problem when running dhcpcd without an interface argument:
> Depending on whether udev or dhcpcd was faster, interface renaming would
> succeed or fail. We are now working around this issue ([1]), but I don't
> particularly like that solution.

So by the time udev kicks in dhcp has been an gone but the interface is up.

It seems doing a ifconfig eth0 down, udevadm trigger, ifconfig enp0s3
up, and redoing the routes and everything works OK with the new name.

Seems I need to either convert our stage1 to udev and get the renaming
done earlier or do some kind of network routine around when udev starts
to do the above manual steps... ugg!


Cheers

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/



More information about the systemd-devel mailing list