diff --git a/internal/pkg/warewulfd/status.go b/internal/pkg/warewulfd/status.go index 3a1191b3..eb4d462d 100644 --- a/internal/pkg/warewulfd/status.go +++ b/internal/pkg/warewulfd/status.go @@ -26,11 +26,6 @@ var statusDB allStatus func init() { statusDB.Nodes = make(map[string]*NodeStatus) - - err := LoadNodeStatus() - if err != nil { - wwlog.Printf(wwlog.ERROR, "Could not prepopulate status DB with nodes: %s\n", err) - } } func LoadNodeStatus() error { diff --git a/internal/pkg/warewulfd/warewulfd.go b/internal/pkg/warewulfd/warewulfd.go index 2c5f4044..1600a637 100644 --- a/internal/pkg/warewulfd/warewulfd.go +++ b/internal/pkg/warewulfd/warewulfd.go @@ -41,6 +41,11 @@ func RunServer() error { fmt.Printf("ERROR: Could not load database: %s\n", err) } + err = LoadNodeStatus() + if err != nil { + wwlog.Printf(wwlog.ERROR, "Could not prepopulate node status DB: %s\n", err) + } + http.HandleFunc("/ipxe/", IpxeSend) http.HandleFunc("/kernel/", KernelSend) http.HandleFunc("/kmods/", KmodsSend)