1
0
mirror of https://github.com/rancher/os.git synced 2025-09-04 16:21:07 +00:00

Add explicit wait to dhcp

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-06-14 20:45:03 +10:00
parent 5078c80c36
commit 8a741c5d32
3 changed files with 7 additions and 1 deletions

View File

@@ -187,7 +187,7 @@ func ApplyNetworkConfigs(netCfg *NetworkConfig) error {
}
func RunDhcp(netCfg *NetworkConfig, setHostname, setDNS bool) error {
log.Debugf("RunDhcp")
log.Debugf("RunDhcp(%V, %v)", setHostname, setDNS)
populateDefault(netCfg)
links, err := netlink.LinkList()
@@ -258,6 +258,10 @@ func runDhcp(netCfg *NetworkConfig, iface string, argstr string, setHostname, se
args = append(args, "--nohook", "resolv.conf")
}
// Wait for lease
// TODO: this should be optional - based on kernel arg?
args = append(args, "-w", "--debug")
args = append(args, iface)
cmd := exec.Command(args[0], args[1:]...)
log.Infof("Running DHCP on %s: %s", iface, strings.Join(args, " "))