[Ovirt-devel] [PATCH node] Kill persistent dhclient on the temporary interface

Alan Pevec apevec at gmail.com
Tue Jul 13 17:35:20 UTC 2010


On Tue, Jul 13, 2010 at 5:55 PM, Alan Pevec <apevec at gmail.com> wrote:
> -             /sbin/dhclient $1
> +             /sbin/dhclient -1 $1
>
> then there wouldn't be dhclient left running.

I jumped the gun, -1 still keeps dhclient running in the background if
there wasn't failure.
Correct patch is:
-            /sbin/dhclient $1
+            /sbin/dhclient -1 $1 \
+             && [ -f /var/run/dhclient.pid ] \
+             && kill $(cat /var/run/dhclient.pid)

Address is already set when dhclient returns, so we can kill it immediately.




More information about the ovirt-devel mailing list