dhcpcd bootscript

DJ Lucas dj at linuxfromscratch.org
Mon Jun 21 18:20:04 PDT 2004


Archaic wrote:
> In /etc/sysconfig/network-devices/services/dhcpcd, you use dhcpcd to
> kill dhcpcd and place a -k in the ifconfig.eth0 file. According to the
> man page -k destroys the cache where as a sigterm will leave the cache
> intact to allow for you to renew the same address. Obviously, getting
> same address each time isn't guaranteed, but some providers keep the
> lease intact for a rather long time (mine keeps it for a week). As long
> as they don't deplete their IP pool while I'm down, I can reconnect and
> receive the same IP over and over. This is common with cable providers
> (I've used 5 different companies that operated this way). Would it be
> better to drop the -k and replace /sbin/dhcpcd $1 $DHCP_STOP with kill
> -15? Also, since the book doesn't not make the location of dhcpcd
> mandatory, the script might do well to drop the explicit use of
> /sbin/dhcpcd.

        -k     Sends SIGHUP signal to the dhcpcd process that is
               currently running.  If  dhcpcd receives SIGHUP it will
               send DCHP_RELEASE message to the server and destroy dhcpcd
               cache. In  a  case  dhcpcd receives  SIGTERM  which  is
               normally  used by shutdown(8) when rebooting the system
               dhcpcd will not send DHCP_RELEASE and  will not  destroy
               cache.  When system boots dhcpcd will use cache to
               request the same IP address from DHCP server which was
               assigned before the system went down.

The important part is sending DHCP_RELEASE.  '-k' would be proper in a 
LAN.  In your opinion, would the following be a good resolution?

if [ "$DHCP_STOP" == "" ]
     kill -15 dhcpcd
else
     dhcpcd "$DHCP_STOP"
fi

> 
> Last, but not least, which is the latest working blfs-bootscript
> package? Numbering has changed, things are getting weird, and I'm lost.
> :)
> 

CVS works, only difference from the released version right now is gpm 
with your suggestion of the optional GPMOPTS variable.  After I get to 
the current bugs, I'll see about a dated release.  Outstanding is to 
make use of PIDFILE in winbind and mysql (to take advantage of 2.1.x lfs 
bootscripts).  Write courier, and also dhcpcd needs work to allow for no 
exit if leastime is set to infinite.

-- DJ Lucas



More information about the blfs-dev mailing list