From 7cd56c198a26b8cef9bb62821490080cc1f8078c Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Tue, 29 Apr 2014 13:28:44 -0600 Subject: [PATCH] Ensure udhcpc is not running for statically defined eth1 interface. This causes issues where the udhcpc process may eventually attempt to acquire a new IP address from VitualBox or VMware's DHCP server, and thus severing the connection to the Docker daemon (from the client's point of view). Sadly this is more of a Tiny Core Linux boot issue with the busybox/udhcpc startup and not in boot2docker so it'll need to be handled in Vagrant middleware. Closes #28 Closes #24 Closes #8 --- Vagrantfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 5c431fe..768463b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -90,8 +90,10 @@ module VagrantPlugins machine.communicate.tap do |comm| networks.each do |n| ifc = "/sbin/ifconfig eth#{n[:interface]}" + pid = "/var/run/udhcpc.eth#{n[:interface]}.pid" broadcast = (IPAddr.new(n[:ip]) | (~ IPAddr.new(n[:netmask]))).to_s comm.sudo("#{ifc} down") + comm.sudo("if [ -f '#{pid}' ]; then kill `cat #{pid}` && rm -f '#{pid}'; fi") comm.sudo("#{ifc} #{n[:ip]} netmask #{n[:netmask]} broadcast #{broadcast}") comm.sudo("#{ifc} up") end