:: Re: [DNG] vdev in chimaera
Inizio della pagina
Delete this message
Reply to this message
Autore: Didier Kryn
Data:  
To: dng
Oggetto: Re: [DNG] vdev in chimaera
Le 07/02/2022 à 16:22, fsmithred via Dng a écrit :
> On 2/7/22 06:35, Didier Kryn wrote:
>> Le 07/02/2022 à 08:29, aitor a écrit :
>>> I've uploaded new iso images fixing a bug related to the last change in
>>> simple-netaid for
>>> compatibility with static ip addresses, that involved the response to
>>> routing table netlink
>>> events triggered by other processes. The images come with vdev by
>>> default. Next step will be
>>> to write a runit script for ifupdown that intend to solve the problem of
>>> the still remaining
>>> (at least booting with vdev) long delayed boot time when using
>>> "allow-hotplug <interface>"
>>> stanzas in /etc/network/interfaces.
>>      The long delay is also present with sysvrc. It can be supressed by
>> just removing the "allow-hotplug" line, without replacing it by an "auto"
>> line, and relying on ifplugd or netplug to detect the presence of the
>> carrier and trigger the configuration of the interface. The delay is
>> suppressed because 'ifup -a' does not find any interface to bring up and
>> carrier to wait for; and then ifplugd/netplug brings them up only when the
>> carrier is detected. Dunno if simple-netaid can play the role of ifplugd
>> or netplug.
>>
>> --     Didier
>>
> I keep updating your check-link-state.patch on /etc/network/interfaces. It
> seems to still be working with allow-hotplug.
>
> The original discussion on DNG is gone, but I saved part of it here:
> https://dev1galaxy.org/viewtopic.php?pid=15493#p15493
>
> I think the line numbers are right for chimaera, but I always edit this
> manually.
>
> --- networking.orig    2021-11-08 08:47:47.520020285 -0500
> +++ patches/networking.patched    2019-12-14 11:13:07.842536000 -0500
> @@ -112,7 +112,13 @@
>                   done)
>           if [ -n "$ifaces" ]
>           then
> -        ifup $ifaces "$@" || true
> +        # link detection does not work unless we up the link
> +        ip link set "$iface" up || true
> +        if [ "$(cat /sys/class/net/$link/operstate)" = up ]
> +        then
> +            echo "$iface"
> +        fi
> +
>           fi
>       fi
>   }
>

    Sorry but I doubt that the patch is from me, specially because I'm
not familiar (yet) with the ip command, which replaced ifconfig.

    The problem I met, like most people with a laptop is that I have
both eth0 and wlan0. Invoquing ifup -a at boot causes a delay when no
Ethernet cable is plugged in, which is the usual situation. This is
because ifupdown then waits for the carrier and only gives up after a
delay, and only then, brings up wlan0 (given eth0 is listed first in the
interfaces file).

    "allow-hotplug" is meant for network *devices* (not cables) you
plug in on the fly, like USB-Ethernet adapters. The word hotplug does
not mean that the cable is plugged in/out on the fly. In most cases,
"allow-hotplug" is equivalent to "auto". But, when bringing up an
interface, ifupdown waits until the carrier is detected or the timeout
is expired. When there is no cable, there is no carrier, and the timeout
is pretty long.

    On the other hand, ifplugd or netplug are awakened when the carrier
is detected on one of the interfaces they control, and then, they invoke
ifup for the interface in question, just when it makes sense. If you
remove the "allow-hotplug" and "auto" stanzas, ifup -a will just do
nothing, hence no wait. Therefore the solution is to install ifplugd or
netplug, configure it, and eliminate the "allow-hotplug" stanzas from
/etc/network/interfaces.

--     Didier