[1.16.2] Using udhcpc?

Laurent Bercot ska-dietlibc at skarnet.org
Wed Jun 22 12:28:38 UTC 2011


> 1. I should start udhcpc from an init.d script at boot time with the
> "-s" switch to point it to a script that will be called each time an
> event occurs that udhcpc must handle

 Yes, exactly.


> 2. Under normal circumstances, I should just let udhcpc keep running
> in the background and it will handle events on its own

 Yes.


> However, how should I tell udhcp that I want it to perform a task such
> as releasing a bail? Should I call it through eg. "udhcpc release",
> send a signal, or go through the runsvdir/runsv?

 If you don't need the lease anymore, just kill udhcpc, i.e. send it a
SIGTERM. Restart udhcpc if you need another lease. That's all.


> Incidently, I'm not clear about how udhcpc and runsvdir/runsv work
> together
> 
> BTW, how should I launch udhcpc from the init.d script? Is it required
> to use the "-f" switch?

 If you have no experience with supervision suites and want to just
run udhcpc from an init.d script, forget what I said about runsvdir and
runsv, and write your standard run-of-the-mill sysv script with start)
stop) restart) and status) stuff, launching udhcpc *without* the -f
switch, and making sure it stores its pid into some file (typically
/var/run/udhcpc-eth0.pid) so you can send it signals.

 runsvdir/runsv is a whole other way of managing services (a "supervision
tree") with a different mindset than sysv scripts. It's a lot better, but
requires getting used to. If you're struggling with making udhcpc work,
don't attempt to switch to the supervision tree model at the same time.
First get a configuration that works for you and that you understand well;
when you have udhcpc up and running the way you want to, you can come
back and learn how runsvdir/runsv works.

-- 
 Laurent


More information about the busybox mailing list