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

2013-10-01 Thread Colin Guthrie
'Twas brillig, and Lennart Poettering at 01/10/13 01:41 did gyre and gimble:
> On Mon, 30.09.13 17:42, Thomas Bächler (tho...@archlinux.org) wrote:
> 
>> 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.
> 
> No, applications should not pick up network devices before udev
> announced them. They should ignore netlink traffic before
> that. NetworkManager actually gets that right...

Yeah this is a slightly interesting case where our "stage1" can bring
the network up. This system is pretty old and runs without udev or
systemd right now (I do have plans to change it but there are only 24
hours in a day and most of them are already ear-marked!).

Stage 1 can bring the network up to allow for a network install via a
small (<20Mb) boot.iso. Once stage 1 is over, we download and switch to
stage 2 which is when udev is started.

I just need to fiddle around a bit to get the right way of taking down
the network, starting udev, then bringing it back up again. It's not
pretty but I'll figure something out.

Long term, I'd rather stage 1 used systemd+udev but that's probably a
task for another day.

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/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-09-30 Thread Lennart Poettering
On Mon, 30.09.13 17:42, Thomas Bächler (tho...@archlinux.org) wrote:

> 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.

No, applications should not pick up network devices before udev
announced them. They should ignore netlink traffic before
that. NetworkManager actually gets that right...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-09-30 Thread Lennart Poettering
On Mon, 30.09.13 16:14, Colin Guthrie (gm...@colin.guthr.ie) wrote:

> 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?

Hmm, what software do you use that configures the network interfaces?

Software really needs to be fixed to ignore devices that have not been
reported as initialized by udev. They are welcome to watch netlink but
never exclusively, they must ignore netlink traffic for devices that
have not been configured with udev yet.

The renaming of the iface is blocked by by the iface being up, that's
all. If you figure out which software is responsible for upping the
iface, you know your culprit.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-09-30 Thread Colin Guthrie
'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/

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-09-30 Thread Thomas Bächler
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.

[1]
https://projects.archlinux.org/archiso.git/commit/?id=7d14796716939fbabb9daba6b6f5294016d63cd4



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-09-30 Thread 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.

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/

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel