Am 09.07.2015 um 18:51 schrieb Vincent Lefevre: > On 2015-07-09 17:29:55 +0200, Michael Biebl wrote: >> I'm not convinced [email protected] should do any link detection. > > Then it shouldn't be triggered for allow-hotplug interfaces.
That doesn't make any sense.
>> If you want link detection, use a software which properly supports that
>> (like systemd-network, NetworkManager or other alternative) or add that
>> to ifupdown natively.
>
> ifupdown supports link detection, as you can see in
> /etc/init.d/networking (the following function ifup_hotplug
> applies to allow-hotplug interfaces in /etc/network/interfaces):
Well, I know what ifupdown does, since part of that shell code is mine.
And no, I wouldn't call that "support for link detection".
> ifup_hotplug () {
> if [ -d /sys/class/net ]
> then
> ifaces=$(for iface in $(ifquery --list --allow=hotplug)
> do
> link=${iface##:*}
> link=${link##.*}
> if [ -e "/sys/class/net/$link" ]
> then
> # 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
> done)
> if [ -n "$ifaces" ]
> then
> ifup $ifaces "$@" || true
> fi
> fi
> }
>
> And this works.
Adding some shell code in an init script is imho the wrong way to
support link detection. This should be added directly to ifup imho.
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature

