From owner-freebsd-hackers@freebsd.org Fri May 18 03:10:09 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C1DCEE77DE for ; Fri, 18 May 2018 03:10:09 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8175181DC6 for ; Fri, 18 May 2018 03:10:08 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w4I39xNn085743 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 May 2018 05:09:59 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: ish@amail.plala.or.jp Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w4I39tlm097083 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 18 May 2018 10:09:55 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: How can I wait for a USB Ethernet adapter to appear to configure lagg on startup? To: Masachika ISHIZUKA , freebsd-hackers@freebsd.org References: <20180518.113009.439302765921485452.ish@amail.plala.or.jp> <5AFE439D.4000801@grosbein.net> From: Eugene Grosbein Message-ID: <5AFE43FF.8020800@grosbein.net> Date: Fri, 18 May 2018 10:09:51 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <5AFE439D.4000801@grosbein.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2018 03:10:09 -0000 18.05.2018 10:08, Eugene Grosbein wrote: >> I use a nootbook machine. >> As this machine has no internal nic, I use a USB ethernet adapter(ue0). >> I want to configure lagg0 of ue0 and iwm0, but I must wait to start >> /etc/rc.d/netif until appearing the ue0. >> I'm using patched netif as follows, but I must keep it whenever >> 'mergemaster -Ui' is run. >> Is there a more elegant way? > > Yes. In fact, you do not need to wait but "hook" on the event of ue0 creation. > We have several ways to do that and simpliest one for network interface is > using /etc/start_if.ue0 script like this: > > #!/bin/sh > > ifconfig ue0 up > ifconfig lagg0 addm ue0 Sorry, this should be "ifconfig lagg0 laggport ue0"