[Pkg-sysvinit-devel] etch: dhclient hangs at boot because of invoked hwclock

Rafal Dabrowa rdabrowa at poczta.onet.pl
Sun Nov 12 14:00:20 CET 2006


This is a problem associated with setting up of an Ethernet interface
via dhcp at system boot. It occurs only when:
* hardware clock is set to local time
* local time is later than GMT (e.g. in Europe)

Scenario is the following:
* udev triggers "eth0 add" event, which causes to start /lib/udev/net.agent
* net.agent waits for adding loopback interface (i.e. until finishes
"ifup -a" in script
   /etc/rcS.d/S40networking) and then invokes ifup program with eth0
interface.
* ifup program runs dhclient (or dhclient3) program with eth0 interface
* concurrently, script S50hwclock.sh is invoked, which changes the
system clock.

    Changing of the system clock changes number of seconds since Epoch
returned by gettimeofday system function. This causes that dhclient
program badly calculates timeout value while waiting for response from
dhcp server: it is set to one hour or even more. If dhclient does not
receive the first dhcp message, it hangs for one hour or even more.

Possible solution: rename S50hwclock.sh to e.g. S38hwclock.sh in
/etc/rcS.d/ directory. Is this possible ?


Rafal




More information about the Pkg-sysvinit-devel mailing list