Index node database for daemon to make lookups always instantaneous
This commit is contained in:
10
internal/app/wwctl/server/reload/main.go
Normal file
10
internal/app/wwctl/server/reload/main.go
Normal 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()
|
||||
}
|
||||
19
internal/app/wwctl/server/reload/root.go
Normal file
19
internal/app/wwctl/server/reload/root.go
Normal 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
|
||||
}
|
||||
11
internal/app/wwctl/server/restart/main.go
Normal file
11
internal/app/wwctl/server/restart/main.go
Normal 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()
|
||||
}
|
||||
19
internal/app/wwctl/server/restart/root.go
Normal file
19
internal/app/wwctl/server/restart/root.go
Normal 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
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user