1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

If DNS override is set, pass --nohook resolv.conf to dhcpd

This commit is contained in:
Josh Curl
2016-04-11 16:44:33 -07:00
parent 2a99724fbf
commit 60ecf3d547
3 changed files with 15 additions and 9 deletions

View File

@@ -187,7 +187,7 @@ func ApplyNetworkConfigs(netCfg *NetworkConfig) error {
for iface, args := range dhcpLinks {
wg.Add(1)
go func(iface, args string) {
runDhcp(iface, args)
runDhcp(netCfg, iface, args)
wg.Done()
}(iface, args)
}
@@ -197,7 +197,7 @@ func ApplyNetworkConfigs(netCfg *NetworkConfig) error {
return err
}
func runDhcp(iface string, argstr string) {
func runDhcp(netCfg *NetworkConfig, iface string, argstr string) {
log.Infof("Running DHCP on %s", iface)
args := []string{}
if argstr != "" {
@@ -211,6 +211,10 @@ func runDhcp(iface string, argstr string) {
args = defaultDhcpArgs
}
if netCfg.Dns.Override {
args = append(args, "--nohook", "resolv.conf")
}
args = append(args, iface)
cmd := exec.Command(args[0], args[1:]...)
cmd.Stdout = os.Stdout