forked from warewulf/warewulf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request warewulf#1229 from anderbubble/warewulfd-foreground
Simplify `wwctl server` command and logging
- Loading branch information
Showing
25 changed files
with
38 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,27 @@ | ||
package server | ||
|
||
import ( | ||
"github.com/pkg/errors" | ||
"github.com/spf13/cobra" | ||
"github.com/warewulf/warewulf/internal/app/wwctl/server/reload" | ||
"github.com/warewulf/warewulf/internal/app/wwctl/server/restart" | ||
"github.com/warewulf/warewulf/internal/app/wwctl/server/start" | ||
"github.com/warewulf/warewulf/internal/app/wwctl/server/status" | ||
"github.com/warewulf/warewulf/internal/app/wwctl/server/stop" | ||
"github.com/warewulf/warewulf/internal/pkg/warewulfd" | ||
) | ||
|
||
var ( | ||
baseCmd = &cobra.Command{ | ||
DisableFlagsInUseLine: true, | ||
Use: "server COMMAND [OPTIONS]", | ||
Short: "Warewulf server process commands", | ||
Long: "This command will allow you to control the Warewulf daemon process.", | ||
Use: "server [OPTIONS]", | ||
Short: "Start Warewulf server", | ||
RunE: CobraRunE, | ||
} | ||
) | ||
|
||
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. | ||
func GetCommand() *cobra.Command { | ||
return baseCmd | ||
} | ||
|
||
func CobraRunE(cmd *cobra.Command, args []string) error { | ||
if err := warewulfd.DaemonInitLogging(); err != nil { | ||
return errors.Wrap(err, "failed to configure logging") | ||
} | ||
return errors.Wrap(warewulfd.RunServer(), "failed to start Warewulf server") | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.