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:
Christian Goll
2025-07-25 15:53:17 +02:00
committed by Jonathon Anderson
parent f2d06d5928
commit 2c51ca7fff
9 changed files with 174 additions and 16 deletions

View 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
}