[Voyage-linux] DHCP Client IP allocation renewal bug

Punky Tse (spam-protected)
Fri Oct 14 10:32:33 HKT 2005


Dave,

I found that dhclient.leases is stored in /var/lib and it is usually 
read-only and is not in ramdisk.  So I think dhcp-client is unable to 
update this file.  Can you try to work around this my creating a symlink 
to /rw/var/lib ?

All scripts in /etc/init.d and the booting framework is from debian. It 
is very unlikely it has bugs.

Regards,
Punky

Dave Williams wrote:

>I've found a bug in the handling of DHCP address allocations.
>When the system boots it gets allocated an address. After the first
>lease time has expired it gets allocated new address rather than
>renewing the existing one. After that it is OK.
>
>The reason for this turns out to be due to the handling of dhclient.eth0.leases
>(and dhclient.eth0.pid). These are stored in /var/run and are used to tell 
>dhclient to do a DHCPREQUEST rather than a DHCPDISCOVER and hence get a
>renewal. These files are created at boot time in S40networking but get deleted
>later during the bootup sequence by an over-enthusiastic cleanrun() function
>in bootclean.sh that is called by S45mountnfs.sh.
>
>The fix is straight forward by adding  ! -name dhclient* to line 93 of
>/etc/init.d/bootclean.sh as shown in the complete function listing
>below.
>
>cleanrun() {
>        #
>        #       Clean up /var/run.
>        #
>
>        [ -f /var/run/.clean ] && return
>
>        [ "$VERBOSE" != no ] && echo -n " /var/run"
>        ( cd /var/run && \
>                find . ! -type d ! -name utmp ! -name innd.pid ! -name dhclient* \
>                -exec rm -f -- {} \; )
>        rm -f /var/run/.clean
>        set -o noclobber
>        :> /var/run/.clean
>        set +o noclobber
>}
>
>It doesnt seem very robust to use negative logic here which could upset
>files placed by other parts of the boot process so maybe there is a
>better overall solution - However this works.
>
>Anyway as I dont know who has editorial control over this file or what is history
>I dont know whether its best to email it to the file's author (miquels at cistron.nl) or
>whether someone on the list here can consider it for inclusion in
>forthcoming releases.
>
>Dave
>
>
>
>_______________________________________________
>Voyage-linux mailing list
>Voyage-linux at list.voyage.hk
>http://list.voyage.hk/mailman/listinfo/voyage-linux
>  
>


-- 
Regards,
Punky
P U N K N ! X  . c o m
Technology + Lifestyle
(http://www.punknix.com)

Voyage Linux
(http://www.voyage.hk/software/voyage.html)






More information about the Voyage-linux mailing list