Subject: bin/12108: dhclient writes /var/run/ too late
To: None <>
From: None <>
List: netbsd-bugs
Date: 02/01/2001 17:04:20
>Number:         12108
>Category:       bin
>Synopsis:       dhclient writes /var/run/ too late
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 01 17:07:00 PST 2001
>Originator:     Kevin Sullivan
>Release:        NetBSD 1.5
Pittsburgh Supercomputing Center
System: NetBSD 1.5 NetBSD 1.5 (BALROG) #2: Wed Jan 31 22:51:39 EST 2001 i386


dhclient follows the following sequence:
  * Aquire lease
  * Configure network
  * fork
    * parent exits
    * child write pid file and loops until the lease expires

The problem is that /etc/rc.d/dhclient cannot kill dhclient until the
pid file is written.  If no lease can be aquired (the ethernet is not
plugged in or the wireless card is out of range) this can take quite a
long time.  If you have /etc/apm scripts which kill and restart
dhclient then you may find them not working.



I believe that the sequence should be:

* fork
  * parent waits for a signal from the child, then exits
  * child:  writes pid file
            aquires lease, configures network
            sends signal to parent then loops