Patch to prevent multiple dhclients starting on an interface

LaMont Jones lamont at ubuntu.com
Wed Jun 15 16:48:11 UTC 2005


On Wed, Jun 15, 2005 at 08:14:15AM -0700, Ted Lemon wrote:
> As a temporary hack, my big complaint about that patch is that it  
> sends a SIGTERM to the pid recorded in the dhclient pidfile, which  
> may be stale, without checking whether or not there's actually a  
> client running by trying to bind to port 68.   I'm running into some  
> obstacles with that check on Ubuntu right now - it always returns  
> positive, even though netstat reports no udp listeners - but I think  
> the right thing is to fix the test and use it, not to rely solely on  
> the pid file.   Otherwise, you run the risk of killing some other  
> process that just happens to have the same pid as the stale dhclient.

You can also look at /proc/<pid>/exe to see if it's a reasonable name
for the client.

Interesting that the bind works, though...

lamont


More information about the dhcp-hackers mailing list