Files
sunhpc/internal/pkg/configure/sunhpcd.go
2026-04-29 22:52:33 +08:00

23 lines
558 B
Go

package configure
import (
sunhpcconf "gitea.sunhpc.com/kelvin/sunhpc/internal/pkg/config"
"gitea.sunhpc.com/kelvin/sunhpc/internal/pkg/util"
"gitea.sunhpc.com/kelvin/sunhpc/internal/pkg/splog"
)
func SUNHPCD() (err error) {
controller := sunhpcconf.Get()
if controller.Sunhpc.SystemdName != "" {
splog.Info("Enabling and restarting the Sunhpc server")
err = util.SystemdStart(controller.Sunhpc.SystemdName)
if err != nil {
return err
}
} else {
splog.Warn("Not (re)starting Sunhpc server: no systemd name configured")
}
return nil
}