diff --git a/cmd/dhcp4/dhcp4.go b/cmd/dhcp4/dhcp4.go index 050516e..dc667dc 100644 --- a/cmd/dhcp4/dhcp4.go +++ b/cmd/dhcp4/dhcp4.go @@ -58,7 +58,7 @@ func logic() error { if err := ioutil.WriteFile(ackFn, c.Ack, 0644); err != nil { return fmt.Errorf("persisting DHCPACK to %s: %v", ackFn, err) } - if err := notify.Process("/user/netconfi", syscall.SIGUSR1); err != nil { + if err := notify.Process("/user/netconfigd", syscall.SIGUSR1); err != nil { log.Printf("notifying netconfig: %v", err) } select { diff --git a/cmd/dhcp6/dhcp6.go b/cmd/dhcp6/dhcp6.go index 7422217..a300b50 100644 --- a/cmd/dhcp6/dhcp6.go +++ b/cmd/dhcp6/dhcp6.go @@ -51,7 +51,7 @@ func logic() error { if err := ioutil.WriteFile(configPath, b, 0644); err != nil { return err } - if err := notify.Process("/user/netconfi", syscall.SIGUSR1); err != nil { + if err := notify.Process("/user/netconfigd", syscall.SIGUSR1); err != nil { log.Printf("notifying netconfig: %v", err) } if err := notify.Process("/user/radvd", syscall.SIGUSR1); err != nil { diff --git a/integrationnetconfig_test.go b/integrationnetconfig_test.go index bc52303..845464d 100644 --- a/integrationnetconfig_test.go +++ b/integrationnetconfig_test.go @@ -108,6 +108,10 @@ func TestNetconfig(t *testing.T) { t.Fatal(err) } + if err := os.MkdirAll(filepath.Join(tmp, "root", "tmp"), 0755); err != nil { + t.Fatal(err) + } + if err := netconfig.Apply(tmp, filepath.Join(tmp, "root")); err != nil { t.Fatalf("netconfig.Apply: %v", err) } @@ -119,12 +123,12 @@ func TestNetconfig(t *testing.T) { t.Fatalf("netconfig.Apply: %v", err) } - b, err := ioutil.ReadFile(filepath.Join(tmp, "root", "etc", "resolv.conf")) + b, err := ioutil.ReadFile(filepath.Join(tmp, "root", "tmp", "resolv.conf")) if err != nil { t.Fatal(err) } if got, want := strings.TrimSpace(string(b)), "nameserver 192.168.42.1"; got != want { - t.Errorf("/etc/resolv.conf: got %q, want %q", got, want) + t.Errorf("/tmp/resolv.conf: got %q, want %q", got, want) } return diff --git a/internal/netconfig/netconfig.go b/internal/netconfig/netconfig.go index efc469f..afba99e 100644 --- a/internal/netconfig/netconfig.go +++ b/internal/netconfig/netconfig.go @@ -257,7 +257,7 @@ func applyInterfaces(dir, root string) error { if details.Name == "lan0" { b := []byte("nameserver " + addr.IP.String() + "\n") - fn := filepath.Join(root, "etc", "resolv.conf") + fn := filepath.Join(root, "tmp", "resolv.conf") if err := os.Remove(fn); err != nil && !os.IsNotExist(err) { return err }