the environment variable WAREWULFCONF is also recognized Signed-off-by: Christian Goll <cgoll@suse.de>
20 lines
499 B
Go
20 lines
499 B
Go
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 := warewulfconf.New()
|
|
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")
|
|
}
|
|
}
|