Patch to prevent multiple dhclients starting on an interface
Ted Lemon
mellon at fugue.com
Wed Jun 15 15:14:15 UTC 2005
On Jun 15, 2005, at 2:55 AM, Andrew Pollock wrote:
> Martin Pitt with his Ubuntu hat on has made a patch to address this.
>
> It's at
>
> http://patches.ubuntu.com/patches/dhcp3.client-running_stale_pids.diff
>
It seems like what this patch does is to make sure that when the
client's run a second time, it kills the first instance of the
client. You're in a difficult spot because of the whole ifup/ifdown
mechanism, which interacts poorly with automatic address
configuration. I really don't think this patch is a good idea, but
the right solution is a lot harder, and not something I expect to see
done to the ISC code anytime soon - you should really be running
dhclient as a single daemon, and sending it events over the d-bus
from the ifup and ifdown scripts.
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.
More information about the dhcp-hackers
mailing list