Subject: bin/12108: dhclient writes /var/run/dhclient.pid too late
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ksulliva@psc.edu>
List: netbsd-bugs
Date: 02/01/2001 17:04:20
>Number:         12108
>Category:       bin
>Synopsis:       dhclient writes /var/run/dhclient.pid 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
>Closed-Date:
>Last-Modified:
>Originator:     Kevin Sullivan
>Release:        NetBSD 1.5
>Organization:
Pittsburgh Supercomputing Center
>Environment:
System: NetBSD balrog1.wv.cc.cmu.edu 1.5 NetBSD 1.5 (BALROG) #2: Wed Jan 31 22:51:39 EST 2001 ksulliva@balrog1.wv.cc.cmu.edu:/home/ksulliva/kern/BALROG i386


>Description:

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.


>How-To-Repeat:

>Fix:

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
>Release-Note:
>Audit-Trail:
>Unformatted: