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-unsubscr...@freebsd.org"