From fac1bf231ec78ada3d2b3bed3aa9d8d4e2dcbec3 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 29 Oct 2018 18:14:01 +0100 Subject: [PATCH] netconfigd: notify dhcp4d to update its listeners --- cmd/netconfigd/netconfigd.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/netconfigd/netconfigd.go b/cmd/netconfigd/netconfigd.go index 74fb2ad..fbffd31 100644 --- a/cmd/netconfigd/netconfigd.go +++ b/cmd/netconfigd/netconfigd.go @@ -32,6 +32,7 @@ import ( "github.com/rtr7/router7/internal/multilisten" "github.com/rtr7/router7/internal/netconfig" + "github.com/rtr7/router7/internal/notify" "github.com/rtr7/router7/internal/teelogger" ) @@ -134,6 +135,13 @@ func logic() error { signal.Notify(ch, syscall.SIGUSR1) for { err := netconfig.Apply("/perm/", "/") + + // Notify dhcp4d so that it can update its listeners for prometheus + // metrics on the external interface. + if err := notify.Process("/user/dhcp4d", syscall.SIGUSR1); err != nil { + log.Printf("notifying dhcp4d: %v", err) + } + // Notify gokrazy about new addresses (netconfig.Apply might have // modified state before returning an error) so that listeners can be // updated.