From owner-freebsd-current Mon Feb 3 11:48:15 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 427E937B401; Mon, 3 Feb 2003 11:48:13 -0800 (PST) Received: from mail.tcoip.com.br (erato.tco.net.br [200.220.254.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 382DB43F75; Mon, 3 Feb 2003 11:48:11 -0800 (PST) (envelope-from dcs@tcoip.com.br) Received: from tcoip.com.br ([10.0.2.6]) by mail.tcoip.com.br (8.11.6/8.11.6) with ESMTP id h13Jlre27265; Mon, 3 Feb 2003 17:47:54 -0200 Message-ID: <3E3EC768.7030707@tcoip.com.br> Date: Mon, 03 Feb 2003 17:47:52 -0200 From: "Daniel C. Sobral" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3a) Gecko/20030128 X-Accept-Language: en-us, en, pt-br, ja MIME-Version: 1.0 To: "M. Warner Losh" Cc: rwatson@FreeBSD.ORG, ob@e-Gitt.NET, freebsd-current@FreeBSD.ORG Subject: Re: Question about devd concept References: <20030202165352.GA6957@e-Gitt.NET> <20030202.112911.101834304.imp@bsdimp.com> In-Reply-To: <20030202.112911.101834304.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG M. Warner Losh wrote: > In message: > Robert Watson writes: > : I ran into a similar problem, actually -- programs like dhclient rely on > : being able to write to lease and pid files. It's almost as though we'd > : like an additional set of events when the system is "more booted". I.e., > : a devd event for each device when the network is started, etc. > > That might make sense. Part of the problem is that while the system > is booting there is only some vague notion of system state once you > get to init. Part of the problem also is that devices have no > information about what type of device any given device is. There's no > way that one could "hold in abeyance" those devices that are network > devices because we have no clue what a network device is and what > isn't. It gets muddier when devices have multiple uses. Is sio a > network device? If it is used for a ppp link it is, but if it is used > for a serial console it isn't... > > : Actually, I suspect what we want is to have a seperate network event > : management daemon -- arrival of the device is not the same as arrival of > : the interface. dhclient events (and related things) should happen as a > : result of the interface arriving, not the newbus device arrival. I.e., a > : netd that listens to routing socket and kqueue events relating to the > : network stack. > > Trouble is that "network interface arrival" is the same as "device > arrival" The network interface is attached in foo_attach() so that's > not a better time to do things because it is the same time. Since it > happens in foo_attach, it actually happens before the device is > entirely attached to the tree, so you are suggesting doing something > that happens earlier :-). While carrier detect might be slightly > better, it still is insufficient because that usually happens before > init is run too. If it was that easy, I'd do it. > > I'm still trying to find the best place to start devd. Right now it > starts before everything else. Maybe it needs to start just after the > network starts, but that's arbitrary. That would ensure that we have > a writeable /var for dhclient, but might preclude other interesting > uses for devd. One could also make a case for just before network > starts too. Doing it after means that one only has to put the 'don't > configure it again' check into one place rather than two. The one in > the second place has generated some problem reports that I need to > look into. > > Part of the problem too is that we're now doing the configuration of > devices in two places. Network devices are the only ones where we do > interesting things with, but I think that we're seeing growning pains > introducing dynamic things into a formerly static system. It is > little different than when pccard and dynamic device loading was added > to the kernel... I think people are coming at this from the wrong direction. The scripts in /etc/rc.d ought to deal with setting up dhclient and whatever else correctly if the device is present (rc.conf settings not precluding this). I think, rather, that it is devd which should call rc.d to do things at device arrival, _after_ bootstrap has completed. -- Daniel C. Sobral (8-DCS) Gerencia de Operacoes Divisao de Comunicacao de Dados Coordenacao de Seguranca TCO Fones: 55-61-313-7654/Cel: 55-61-9618-0904 E-mail: Daniel.Capo@tco.net.br Daniel.Sobral@tcoip.com.br dcs@tcoip.com.br Outros: dcs@newsguy.com dcs@freebsd.org capo@notorious.bsdconspiracy.net The most interesting specimen will not be labeled. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message