added warewuld configure option
Co-authored-by: Jonathon Anderson <janderson@ciq.com> Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
f2d06d5928
commit
2c51ca7fff
22
internal/pkg/configure/warewulfd.go
Normal file
22
internal/pkg/configure/warewulfd.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package configure
|
||||
|
||||
import (
|
||||
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
|
||||
"github.com/warewulf/warewulf/internal/pkg/util"
|
||||
"github.com/warewulf/warewulf/internal/pkg/wwlog"
|
||||
)
|
||||
|
||||
func WAREWULFD() (err error) {
|
||||
controller := warewulfconf.Get()
|
||||
if controller.Warewulf.SystemdName != "" {
|
||||
wwlog.Info("Enabling and restarting the Warewulf server")
|
||||
err = util.SystemdStart(controller.Warewulf.SystemdName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
wwlog.Warn("Not (re)starting Warewulf server: no systemd name configured")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user