From owner-freebsd-current@FreeBSD.ORG Tue Aug 21 21:38:13 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 812E81065672 for ; Tue, 21 Aug 2012 21:38:13 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta06.emeryville.ca.mail.comcast.net (qmta06.emeryville.ca.mail.comcast.net [76.96.30.56]) by mx1.freebsd.org (Postfix) with ESMTP id 581E58FC0C for ; Tue, 21 Aug 2012 21:38:13 +0000 (UTC) Received: from omta15.emeryville.ca.mail.comcast.net ([76.96.30.71]) by qmta06.emeryville.ca.mail.comcast.net with comcast id pZMh1j0051Y3wxoA6Ze7Js; Tue, 21 Aug 2012 21:38:07 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta15.emeryville.ca.mail.comcast.net with comcast id pZe61j0024NgCEG8bZe6j9; Tue, 21 Aug 2012 21:38:07 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q7LLc4xG022878; Tue, 21 Aug 2012 15:38:04 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Warner Losh In-Reply-To: References: <20120821095527.GA33206@hell.ukr.net> <67977762.20120821154035@serebryakov.spb.ru> <1959717636.20120821155308@serebryakov.spb.ru> <201208210934.31484.jhb@freebsd.org> <1049151425.20120821190433@serebryakov.spb.ru> <1345562163.27688.347.camel@revolution.hippie.lan> <709115163.20120821192652@serebryakov.spb.ru> <1345564507.27688.354.camel@revolution.hippie.lan> <1409150425.20120821210152@serebryakov.spb.ru> <1345570590.27688.367.camel@revolution.hippie.lan> <686419050.20120821214225@serebryakov.spb.ru> Content-Type: text/plain; charset="koi8-r" Date: Tue, 21 Aug 2012 15:38:04 -0600 Message-ID: <1345585084.27688.377.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Cc: lev@freebsd.org, freebsd-current@freebsd.org Subject: Re: r239356: does it mean, that synchronous dhcp and dhcplcinet with disabled devd gone? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 21:38:13 -0000 On Tue, 2012-08-21 at 14:04 -0600, Warner Losh wrote: > On Aug 21, 2012, at 11:42 AM, Lev Serebryakov wrote: > > > Hello, Ian. > > You wrote 21 августа 2012 г., 21:36:30: > > > > IL> I think it's funny how people have this knee-jerk reaction against C++ > > IL> apps. The devd executable is not exactly an example of bloatware: 374k > > IL> statically linked (so it already includes this "C++ runtime" that you > > IL> think is large). We routinely deploy embedded systems that use apps > > IL> written exclusively in C++, on systems that only have 32 or 64mb of ram. > > IL> We've been doing so since the days when the biggest compact flash card > > IL> you could buy was 64mb. > > BTW, typical MIPS SoC-based router has only 16MiB of flash. And, > > yes, FreeBSD doesn't fit well in this size now, but why add another > > mandatory program, only role of which is to monitor network cable and > > re-run the same program every time? > > You'd typically not run dhclient in daemon mode in a SoC, since you don't want to chew up the memory all the time, and you'd likely replace the system dhclient with one that's simpler... But the network notification part of devd would be trivial to reproduce if you wanted in a specialized daemon that would do what's required. > > Warner > For example, this script can replace devd as a daemon that restarts dhclient when any link comes back up... #!/bin/sh daemon_loop () { while true; do read line if [ -z "${line##!system=IFNET subsystem=* type=LINK_UP}" ] ; then eval ${line##!} /sbin/dhclient $subsystem fi done } cat /dev/devctl | daemon_loop Of course the right thing to do is invoke the proper rc scripts rather than dhclient directly... this is just to illustrate how easy it is to replace devd if your needs are specialized. -- Ian