Daemon logging to syslog (#152)

This commit is contained in:
Gregory Kurtzer
2021-09-30 23:40:16 -07:00
parent 384c4c0286
commit 238b61a682
5 changed files with 81 additions and 35 deletions

View File

@@ -1,13 +1,20 @@
package start
import (
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
func CobraRunE(cmd *cobra.Command, args []string) error {
if SetForeground {
conf, err := warewulfconf.New()
if err != nil {
return errors.Wrap(err, "Could not read Warewulf configuration file")
}
conf.Warewulf.Syslog = false
return errors.Wrap(warewulfd.RunServer(), "failed to start Warewulf server")
} else {
return errors.Wrap(warewulfd.DaemonStart(), "failed to start Warewulf server")