Denys, > -----Original Message----- > From: Denys Vlasenko [mailto:[email protected]] > Sent: Thursday, February 20, 2014 5:28 PM > To: Bryan Evenson > Cc: [email protected] > Subject: Re: Looking for simple ifplugd example script > > On Thu, Feb 20, 2014 at 5:14 PM, Bryan Evenson > <[email protected]> wrote: > > I am using busybox-1.20.2 on an embedded Debian Linux machine, and I > have configured Busybox to include ifplugd. I would like ifplugd to do the > following: > > > > 1. When the Ethernet cable is plugged in, attempt DHCP on eth0 2. If > > DHCP fails, use a set static IP address 3. When the Ethernet cable is > > unplugged, unconfigure eth0 > > > > At this point, ifplugd is not running. After some poking around, I see that > there is no default daemon script for ifplugd included with Busybox. I'm > assuming a script to do the above isn't that difficult, but I can't seem to > find > any examples on how to do this. Does anyone have a simple example that I > can go by? I did see the example in the Busybox source under > examples/var_service/ifplugd_if, but I couldn't make any sense of what that > script did and how to make use of it. > > It means that busybox/examples/var_service/README is badly located, or > badly written, or both. >
I found the README you were talking about. I have never used runsvdir before and I don't have it included in my version of Busybox. I didn't realize that Busybox was assuming you'd use runsvdir to run ifplugd, which was the start of my confusion. And since I didn't know that's what was assumed, I didn't think to look a couple directories up for a related README. A little more background on my system. It's an ARM family processor and I'm using the Yocto Project's Poky distribution on my system. The default image for that build uses sysVinit and is setup for ifup/ifdown. So if I wanted to use ifplugd, is the suggestion that I include runsvdir and runsv in my Busybox configuration and use it to run ifplugd? I'm unclear what runsvdir is doing that sysVinit can't. > Did you find it? If no, how this can e improved? > Please read it, and tell me where it is not clear. > > > On a related note, I have eth0 setup in /etc/network/interfaces as: > > auto eth0 > > iface eth0 inet dhcp > > > > If I want to use a static IP address if DHCP fails, do I need to add > > something > to /etc/network/interfaces, or is that something that would belong in the > ifplugd script? > > If you want sane networking in a non-trivial situation, I think ifup isn't the > tool. If not ifup, what would you suggest? I'm open to ideas, just looking for the simplest path to get to where I want to go. Thanks, Bryan _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
