Skip to content

Commit

Permalink
Ensure udhcpc is not running for statically defined eth1 interface.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fnichol committed Apr 29, 2014
1 parent 92a8caf commit 7cd56c1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cd56c1

Please sign in to comment.