Automatically reload daemon configuration file when configuration file is changed.

This commit is contained in:
Gregory Kurtzer
2021-02-12 23:00:03 -08:00
parent e7c6fe3abe
commit 88dbec7ed9
4 changed files with 9 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/spf13/cobra"
"os"
@@ -79,6 +80,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
nodeDB.Persist()
fmt.Printf("Set default profile to container: %s\n", name)
warewulfd.DaemonReload()
}

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/hpcng/warewulf/internal/pkg/kernel"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/spf13/cobra"
"os"
@@ -43,6 +44,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
nodeDB.Persist()
fmt.Printf("Set default kernel version to: %s\n", args[0])
warewulfd.DaemonReload()
}
}

View File

@@ -5,6 +5,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
@@ -274,6 +275,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
if result == "y" || result == "yes" {
nodeDB.Persist()
warewulfd.DaemonReload()
}
}

View File

@@ -5,6 +5,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
@@ -251,6 +252,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
if result == "y" || result == "yes" {
nodeDB.Persist()
warewulfd.DaemonReload()
}
} else {