Index node database for daemon to make lookups always instantaneous

This commit is contained in:
Gregory Kurtzer
2021-02-12 22:58:22 -08:00
parent 30c6b64413
commit d00ea3ba00
11 changed files with 184 additions and 28 deletions

View File

@@ -0,0 +1,10 @@
package reload
import (
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/spf13/cobra"
)
func CobraRunE(cmd *cobra.Command, args []string) error {
return warewulfd.DaemonReload()
}

View File

@@ -0,0 +1,19 @@
package reload
import "github.com/spf13/cobra"
var (
baseCmd = &cobra.Command{
Use: "reload",
Short: "Reload the Warewulf server configuration",
RunE: CobraRunE,
}
)
func init() {
}
// GetRootCommand returns the root cobra.Command for the application.
func GetCommand() *cobra.Command {
return baseCmd
}

View File

@@ -0,0 +1,11 @@
package restart
import (
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/spf13/cobra"
)
func CobraRunE(cmd *cobra.Command, args []string) error {
warewulfd.DaemonStop()
return warewulfd.DaemonStart()
}

View File

@@ -0,0 +1,19 @@
package restart
import "github.com/spf13/cobra"
var (
baseCmd = &cobra.Command{
Use: "restart",
Short: "Restart the Warewulf server",
RunE: CobraRunE,
}
)
func init() {
}
// GetRootCommand returns the root cobra.Command for the application.
func GetCommand() *cobra.Command {
return baseCmd
}

View File

@@ -1,6 +1,8 @@
package server
import (
"github.com/hpcng/warewulf/internal/app/wwctl/server/reload"
"github.com/hpcng/warewulf/internal/app/wwctl/server/restart"
"github.com/hpcng/warewulf/internal/app/wwctl/server/start"
"github.com/hpcng/warewulf/internal/app/wwctl/server/status"
"github.com/hpcng/warewulf/internal/app/wwctl/server/stop"
@@ -20,6 +22,9 @@ func init() {
baseCmd.AddCommand(start.GetCommand())
baseCmd.AddCommand(status.GetCommand())
baseCmd.AddCommand(stop.GetCommand())
baseCmd.AddCommand(restart.GetCommand())
baseCmd.AddCommand(reload.GetCommand())
}
// GetRootCommand returns the root cobra.Command for the application.