Re: r239356: does it mean, that synchronous dhcp and dhcplcinet

看板FB_current作者時間13年前 (2012/08/22 06:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串11/18 (看更多)
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 _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1GD0KUFD (FB_current)
討論串 (同標題文章)
完整討論串 (本文為第 11 之 18 篇):
文章代碼(AID): #1GD0KUFD (FB_current)