On Monday 18 February 2002 21:57, Matt Schalit wrote:
> In the old days, these were the notes I made:
>
>   ##
>    #  If a dhcp client ran, then it left a pid file and a server ip
> file: #
>    #   _____ dhcpcd _______                 _______ dhclient
> ___________ #  /var/run/dhcpcd-eth0.pid             
> /var/run/dhclient.pid #  /etc/dhcpc/dhcpcd-eth0.info          
> /var/run/state/dhcp/dhclient.leases ##
>
> How does this work for udhcp now, please?

I haven't found all of these implicitly documented, so
there is some hunt and peck for a couple of them.

Of the one's that I specified (in init.d):

/var/state/dhcp/udhcpd.leases is the server lease file.
You will probably want to use the /usr/sbin/dumpleases
binary to convert the binary data to hex (still sux ;)

The udhcpd pid file is /var/run/udhcpd.pid

Only dhcpc has a pid file (that I know of), it is set with
the start command in /etc/init.d/udhcpc and is kept in
/var/run/udhcpc.pid. It can be changed by root.

I set a boolean (1 or 0) status file in /var/state/dhcp/udhcpc 
to make it easy to check the status of the daemon. The
"1" is up and "0" is down. 

The "start-stop-daemon" command does not allow for switches 
being added to the --exec file, so I dropped this in the "start"
command. From testing, the file is being run as a stand-alone 
process (that only allows for one instance as far as I can tell) 
and works correctly with the "start-stop-daemon --stop" command. 

I do not know where the lease information is kept for the client
(whether a file or in RAM is questionable from the docs). The 
$lease variable is the lease time given at the time of status change 
in seconds The $ipttl variable is the time to live for the lease (I'm
assuming in seconds). From this, I would assume we could script
something to a file from the environmental variables (lease time,
ip/route info, current time, and status) and maybe do something
from $ipttl for a lease time check on the fly. 

I really haven't played with this, but I see some possibilties.What I
have taken from the docs is that this really isn't built in at this
time anyway.


>   Unfortunately, that's what I wanted to know when
> I mistakenly asked about udhcp.conf.  I just wanted
> to know how to interact with a running dhcp client,
> not configure one. :-)

OK, I didn't catch that ;)
It's really not that well documented for run time options.

I hope this helps!
-- 

~Lynn Avants
aka Guitarlynn

guitarlynn at users.sourceforge.net
http://leaf.sourceforge.net

If linux isn't the answer, you've probably got the wrong question!

_______________________________________________
Leaf-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user

Reply via email to